DSPRelated.com
Forums

FSK modulated wave file

Started by pal.debabrata123 June 27, 2007
Hey guys, 
Though my problem is do a FSK modulation os an ascii string and send it to
telephone between "init ring" and "full ring" , I don't know how to test.
Is there a software FSK demodulator free somewhere? Can I get some
standard FSK modulated file to test the decoder? So that I am test my code
in that environment.. 


On Jun 27, 9:07 am, "pal.debabrata123" <pal.debabrata...@gmail.com>
wrote:
> Hey guys, > Though my problem is do a FSK modulation os an ascii string and send it to > telephone between "init ring" and "full ring" , I don't know how to test. > Is there a software FSK demodulator free somewhere? Can I get some > standard FSK modulated file to test the decoder? So that I am test my code > in that environment..
You can use a caller id box as a decoder - they are quite inexpensive these days. Or you can write some code in Matlab, MathCad, Scilab or something similar to decode and examine your data. And you may record real caller id data from a phone line. IIRC the caller ID stuff is a simple Bell 202 data burst, so there should be a lot of info on this. Clay
pal.debabrata123 wrote:
> Hey guys, > Though my problem is do a FSK modulation os an ascii string and send it to > telephone between "init ring" and "full ring" , I don't know how to test. > Is there a software FSK demodulator free somewhere? Can I get some > standard FSK modulated file to test the decoder? So that I am test my code > in that environment..
Try http://www.soft-switch.org, and look for spandsp Steve
>On Jun 27, 9:07 am, "pal.debabrata123" <pal.debabrata...@gmail.com> >wrote: >> Hey guys, >> Though my problem is do a FSK modulation os an ascii string and send it
to
>> telephone between "init ring" and "full ring" , I don't know how to
test.
>> Is there a software FSK demodulator free somewhere? Can I get some >> standard FSK modulated file to test the decoder? So that I am test my
code
>> in that environment.. > > >You can use a caller id box as a decoder - they are quite inexpensive >these days. Or you can write some code in Matlab, MathCad, Scilab or >something similar to decode and examine your data. And you may record >real caller id data from a phone line. IIRC the caller ID stuff is a >simple Bell 202 data burst, so there should be a lot of info on this. > >Clay
Aha! that's a good suggestion , anyways http://codegods.net/cidmage/cidmage1.htm has a fsk demodulator adhereing to bell 202 (14 days free version ) so I used that and it is working!!!
> > >
>pal.debabrata123 wrote: >> Hey guys, >> Though my problem is do a FSK modulation os an ascii string and send it
to
>> telephone between "init ring" and "full ring" , I don't know how to
test.
>> Is there a software FSK demodulator free somewhere? Can I get some >> standard FSK modulated file to test the decoder? So that I am test my
code
>> in that environment.. > >Try http://www.soft-switch.org, and look for spandsp > >Steve >
SHi Steve , spandsp is great , but before I had a look in your fsk.c I ended up with another way of maintaing the phase coherence. I am generating the sinusoidal with an oscillator , as you know it is like present_value= beta * previous_value - previous_to_previous value. so at the point of time of switching frequency, previous_value remains same, beta changes ( either of two constants) and previous_to_prevoius value is recomputed to match the new frequency. The floating point code looks like: float find_q1(float q_0, float q_1, int present_bit) { //q_1 is the present val , q_0 will be the same float ret_val; float float_cosX, float_q0, float_q1, val1,val2; float val3,val4; float sin_T[2] = {0.30845 , 0.183 }; float cos_T[2] = {0.95124 , 0.9832 }; float_q0 = (float)q_0 ; float_q1 = (float)q_1 ; float_cosX = sqrt(.25 - (float_q0 * float_q0 )); val1= (float_q0 * cos_T[present_bit]) - (float_cosX * sin_T[present_bit]) ; val2= (float_q0 * cos_T[present_bit]) + (float_cosX * sin_T[present_bit]) ; val3=val1-float_q1; val4=val2-float_q1; if (val3<0) val3=-val3; if (val4<0) val4=-val4; if(val3 < val4) ret_val= val1 ; if(val3 >= val4) ret_val= val2 ; return ret_val ; } I have seen the generated sound samples ! there is no discontinuity!
pal.debabrata123 wrote:
> SHi Steve , spandsp is great , but before I had a look in your fsk.c I > ended up with another way of maintaing the phase coherence. I am > generating the sinusoidal with an oscillator , as you know it is like > present_value= beta * previous_value - previous_to_previous value. > so at the point of time of switching frequency, previous_value remains > same, beta changes ( either of two constants) and previous_to_prevoius > value is recomputed to match the new frequency.
In case you're wondering about the "magic" behind this oscillator, it's based on this trig identity: sin(a+b) = 2cos(b) * sin(a) - sin(a-b) "b" is the phase difference between successive steps. sin(a) is the previous, and sin(a-b) is the previous-previous. I learned that here a few years ago, and I used it last week. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536 A great mind thinks alike.
On Jul 2, 9:46 am, Jim Thomas <jtho...@bittware.com> wrote:
> pal.debabrata123 wrote: > > SHi Steve , spandsp is great , but before I had a look in your fsk.c I > > ended up with another way of maintaing the phase coherence. I am > > generating the sinusoidal with an oscillator , as you know it is like > > present_value= beta * previous_value - previous_to_previous value. > > so at the point of time of switching frequency, previous_value remains > > same, beta changes ( either of two constants) and previous_to_prevoius > > value is recomputed to match the new frequency. > > In case you're wondering about the "magic" behind this oscillator, it's > based on this trig identity: > > sin(a+b) = 2cos(b) * sin(a) - sin(a-b) > > "b" is the phase difference between successive steps. > sin(a) is the previous, and sin(a-b) is the previous-previous. > > I learned that here a few years ago, and I used it last week. > > -- > Jim Thomas Principal Applications Engineer Bittware, Inc > jtho...@bittware.com http://www.bittware.com (603) 226-0404 x536 > A great mind thinks alike.
That is a great trig theorem. Most of us learn it in a form like sin(a)*cos(b) = 0.5(sin(a+b) + sin(a-b)) or maybe with the factor of two moved over on the left. So the above "oscilator form" seems a little weird to us today, but Francois Vieta who discovered many of the trig theorems actually put the theorem into the form of sin(a+b) = 2*sin(a)*cos(b) - sin(a-b) which he used to recursively construct some of the earliest trig tables. So he was the guy to work out one of the earliest sinusoidal oscillators. His work dates from the late 1500s - amazing! Clay
Clay wrote:
> On Jul 2, 9:46 am, Jim Thomas <jtho...@bittware.com> wrote: >> pal.debabrata123 wrote: >>> SHi Steve , spandsp is great , but before I had a look in your fsk.c I >>> ended up with another way of maintaing the phase coherence. I am >>> generating the sinusoidal with an oscillator , as you know it is like >>> present_value= beta * previous_value - previous_to_previous value. >>> so at the point of time of switching frequency, previous_value remains >>> same, beta changes ( either of two constants) and previous_to_prevoius >>> value is recomputed to match the new frequency. >> In case you're wondering about the "magic" behind this oscillator, it's >> based on this trig identity: >> >> sin(a+b) = 2cos(b) * sin(a) - sin(a-b) >> >> "b" is the phase difference between successive steps. >> sin(a) is the previous, and sin(a-b) is the previous-previous. >> >> I learned that here a few years ago, and I used it last week. >> >> -- >> Jim Thomas Principal Applications Engineer Bittware, Inc >> jtho...@bittware.com http://www.bittware.com (603) 226-0404 x536 >> A great mind thinks alike. > > That is a great trig theorem. Most of us learn it in a form like > > sin(a)*cos(b) = 0.5(sin(a+b) + sin(a-b)) > > or maybe with the factor of two moved over on the left. So the above > "oscilator form" seems a little weird to us today, but Francois Vieta > who discovered many of the trig theorems actually put the theorem into > the form of > > sin(a+b) = 2*sin(a)*cos(b) - sin(a-b) > > which he used to recursively construct some of the earliest trig > tables. So he was the guy to work out one of the earliest sinusoidal > oscillators. His work dates from the late 1500s - amazing! > > Clay
I was fooling with my incarnation of this oscillator before the holiday, and found something that I should have expected, but which I found to be simply delightful. I wanted to assure myself that if I tried to generate a frequency greater than fs/2, that it would alias properly. All I had to do was visualize a plot of 2*cos(b) from 0 to 2pi (or more than one cycle). Turns out 2*cos(b) is symmetric in exactly the same was that frequency aliases are. I love it when a plan comes together. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (603) 226-0404 x536 Today is the last day of your life so far.
Jim Thomas wrote:

   ...

> I love it when a plan comes together.
That's why you're on the A Team! Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Jim Thomas wrote:
> Clay wrote: >> On Jul 2, 9:46 am, Jim Thomas <jtho...@bittware.com> wrote: >>> pal.debabrata123 wrote: >>>> SHi Steve , spandsp is great , but before I had a look in your fsk.c I >>>> ended up with another way of maintaing the phase coherence. I am >>>> generating the sinusoidal with an oscillator , as you know it is like >>>> present_value= beta * previous_value - previous_to_previous value. >>>> so at the point of time of switching frequency, previous_value >>>> remains >>>> same, beta changes ( either of two constants) and previous_to_prevoius >>>> value is recomputed to match the new frequency. >>> In case you're wondering about the "magic" behind this oscillator, it's >>> based on this trig identity: >>> >>> sin(a+b) = 2cos(b) * sin(a) - sin(a-b) >>> >>> "b" is the phase difference between successive steps. >>> sin(a) is the previous, and sin(a-b) is the previous-previous. >>> >>> I learned that here a few years ago, and I used it last week. >>> >>> -- >>> Jim Thomas Principal Applications Engineer Bittware, Inc >>> jtho...@bittware.com http://www.bittware.com (603) 226-0404 x536 >>> A great mind thinks alike. >> >> That is a great trig theorem. Most of us learn it in a form like >> >> sin(a)*cos(b) = 0.5(sin(a+b) + sin(a-b)) >> >> or maybe with the factor of two moved over on the left. So the above >> "oscilator form" seems a little weird to us today, but Francois Vieta >> who discovered many of the trig theorems actually put the theorem into >> the form of >> >> sin(a+b) = 2*sin(a)*cos(b) - sin(a-b) >> >> which he used to recursively construct some of the earliest trig >> tables. So he was the guy to work out one of the earliest sinusoidal >> oscillators. His work dates from the late 1500s - amazing! >> >> Clay > > I was fooling with my incarnation of this oscillator before the holiday, > and found something that I should have expected, but which I found to be > simply delightful. I wanted to assure myself that if I tried to > generate a frequency greater than fs/2, that it would alias properly. > > All I had to do was visualize a plot of 2*cos(b) from 0 to 2pi (or more > than one cycle). Turns out 2*cos(b) is symmetric in exactly the same > was that frequency aliases are. > > I love it when a plan comes together.
Like any recursive oscillator, this one has the potential to wander. I turned to using DDS wherever possible, so I never have to worry about that. Steve