DSPRelated.com
Forums

FSK modulation and demodulation

Started by vd.a...@yahoo.co.in August 21, 2009
Hi,

I am new to digital communication area. I want to FSK modulate my .wav file and also demodulate it in matlab (& also in simulink).

After going through matlab documentation and demo, i found that FSK modulator (in simulink or in matlab) accepts only binary data (zero's and one's) as input. I am unable to convert my .wav file into binary as it is already in integer format also includes negetive values in it.

Can anyone guide me, how to start with this and what all steps to be followed to modulate and demodulate the .wav file.

Thanks !
Ashwini
You are on the right track of reading the matlab documentation.
Shannon's communication model should be followed. Firstly, source coding
needs to be done to .wav files. Simply *quantize *the signal and follow the
remaining blocks of the Shannon's communication model.

Good luck,
-Tilak

On Wed, Aug 19, 2009 at 8:06 AM, wrote:

> Hi,
>
> I am new to digital communication area. I want to FSK modulate my .wav file
> and also demodulate it in matlab (& also in simulink).
>
> After going through matlab documentation and demo, i found that FSK
> modulator (in simulink or in matlab) accepts only binary data (zero's and
> one's) as input. I am unable to convert my .wav file into binary as it is
> already in integer format also includes negetive values in it.
>
> Can anyone guide me, how to start with this and what all steps to be
> followed to modulate and demodulate the .wav file.
>
> Thanks !
> Ashwini
>
>
You could try converting all the integers to their equivalent binary format
before modulating the signal. You will need to determine the no. of bits
needed for representing the range of integers in the file. For e.g., with 4
bits of which MSB is sign bit you can represent the integers in the range -8
to +7. If this range accomodates the .wav file contents, then you can obtain
the bit-equivalent representation of -ve numbers by the following (example
below is for finding binary equivalent of -4 with 4 bits. The answer is 1100
or C in HEX. The binary equivalent for +ve integers is obvious.)

dec2bin(2^4-4)

ans
1100

Similarly for -3 you get 1101 and for -2 you get 1110.

HTH,
Sameer

On Tue, Aug 18, 2009 at 11:06 PM, wrote:

> Hi,
>
> I am new to digital communication area. I want to FSK modulate my .wav file
> and also demodulate it in matlab (& also in simulink).
>
> After going through matlab documentation and demo, i found that FSK
> modulator (in simulink or in matlab) accepts only binary data (zero's and
> one's) as input. I am unable to convert my .wav file into binary as it is
> already in integer format also includes negetive values in it.
>
> Can anyone guide me, how to start with this and what all steps to be
> followed to modulate and demodulate the .wav file.
>
> Thanks !
> Ashwini
>
>

--
----
Our greatest glory consists not in never falling, but in rising every time
we fall.
-Oliver Goldsmith
Ashwini,

Your idea is correct in my opinion. As I wrote in my email, the integer
which you convert these decimal numbers to are then converted to the
equivalent bits. So bigger the chosen multiplying factor (in your example
you've selected 1000), the more faithful will be the signal representation.
However, you cannot choose a factor immeasurably large because real-life
systems (especially of the embedded variety) cannot accommodate very large
numbers of bits. More the bits needed, more are the number of gates and
other hardware needed to implement the system on a chip.

This is exactly the idea behind fixed-point implementations, where you are
trading off the number of bits needed to faithfully reproduce the input
signals (and hence the chip space necessary) and the overall system
performance.

Sameer
On Sun, Aug 23, 2009 at 9:28 PM, Ashwini V wrote:

>
> But i am also looking for converting negative decimals., for ex: -5.55,
> -6.987 etc.,
>
> One way i could find is multiplying numbers by 1000 to make integers then
> use your method to make them binary and process them and again scale them
> down while retrieving back the original signal.
> I am not sure about this method whether it works faithfully.
>
> But if there is any other better way, plz suggest me.
>
> Thanks !
> Ashwini
>
> ------------------------------
> *From:* Sameer Herlekar
> *To:* v...@yahoo.co.in
> *Cc:* m...
> *Sent:* Friday, 21 August, 2009 10:08:23 PM
> *Subject:* Re: [matlab] FSK modulation and demodulation
>
> You could try converting all the integers to their equivalent binary format
> before modulating the signal. You will need to determine the no. of bits
> needed for representing the range of integers in the file. For e.g., with 4
> bits of which MSB is sign bit you can represent the integers in the range -8
> to +7. If this range accomodates the .wav file contents, then you can obtain
> the bit-equivalent representation of -ve numbers by the following (example
> below is for finding binary equivalent of -4 with 4 bits. The answer is 1100
> or C in HEX. The binary equivalent for +ve integers is obvious.)
>
> dec2bin(2^4- 4)
>
> ans >
> 1100
>
> Similarly for -3 you get 1101 and for -2 you get 1110.
>
> HTH,
> Sameer
> On Tue, Aug 18, 2009 at 11:06 PM,
> > wrote:
>
>> Hi,
>>
>> I am new to digital communication area. I want to FSK modulate my .wav
>> file and also demodulate it in matlab (& also in simulink).
>>
>> After going through matlab documentation and demo, i found that FSK
>> modulator (in simulink or in matlab) accepts only binary data (zero's and
>> one's) as input. I am unable to convert my .wav file into binary as it is
>> already in integer format also includes negetive values in it.
>>
>> Can anyone guide me, how to start with this and what all steps to be
>> followed to modulate and demodulate the .wav file.
>>
>> Thanks !
>> Ashwini
>> --
> ------------ --------- --------- --------- --------- --------- ---------
> --------- --------- --------- --------- --------- -
> Our greatest glory consists not in never falling, but in rising every time
> we fall.
> -Oliver Goldsmith
>
>
> ------------------------------
> Looking for local information? Find it on Yahoo! Local
--
----
Our greatest glory consists not in never falling, but in rising every time
we fall.
-Oliver Goldsmith