Reply by Tauno Voipio July 3, 20142014-07-03
On 3.7.14 11:29, Rick Lyons wrote:
> On Sun, 29 Jun 2014 12:17:55 -0500, Frnak McKenney > <frnak@far.from.the.madding.crowd.com> wrote: > > [Snipped by Lyons] > >>> Time to re-read "Eats, Shoots, & Leaves", or perhaps to put your copy of >>> Strunk & White under the pillow at night and hope you re-absorb the >>> wisdom by osmosis. >> >> Then follow it up with this: >> >> Spell It Out: The Curious, Enthralling and Extraordinary Story of >> English Spelling >> David Crystal >> http://www.amazon.com/Spell-Out-Enthralling-Extraordinary-Spelling/dp/1250003474/ >> >> English, it turns out, is the end result of numerous attempts at regular- >> ization and simplification... by multiple individuals and groups >> separated in time and space. Watching the author trace this process is >> highly entertaining, and the results are about as you might expect, with >> as many "correct" answers as you get to other "simple" questions like >> "How do you make bread?" and "How do you design an amplifier?" >> >> Enjoy... > > Hi Frank, > The English letter combination "ough" can be > pronounced in many different ways. The following > sentence contains nine ways: > > "A rough-coated, dough-faced, thoughtful > ploughman strode through the streets of > Scarborough; after falling into a slough, > he coughed and hiccoughed." > > [-Rick-] >
This is not very far form G.B.Shaw's 'ghoti' which is pronounced in the same way as 'fish'. -- Tauno Voipio
Reply by Rick Lyons July 3, 20142014-07-03
On Sun, 29 Jun 2014 12:17:55 -0500, Frnak McKenney
<frnak@far.from.the.madding.crowd.com> wrote:

   [Snipped by Lyons]

>> Time to re-read "Eats, Shoots, & Leaves", or perhaps to put your copy of >> Strunk & White under the pillow at night and hope you re-absorb the >> wisdom by osmosis. > >Then follow it up with this: > > Spell It Out: The Curious, Enthralling and Extraordinary Story of > English Spelling > David Crystal > http://www.amazon.com/Spell-Out-Enthralling-Extraordinary-Spelling/dp/1250003474/ > >English, it turns out, is the end result of numerous attempts at regular- >ization and simplification... by multiple individuals and groups >separated in time and space. Watching the author trace this process is >highly entertaining, and the results are about as you might expect, with >as many "correct" answers as you get to other "simple" questions like >"How do you make bread?" and "How do you design an amplifier?" > >Enjoy...
Hi Frank, The English letter combination "ough" can be pronounced in many different ways. The following sentence contains nine ways: "A rough-coated, dough-faced, thoughtful ploughman strode through the streets of Scarborough; after falling into a slough, he coughed and hiccoughed." [-Rick-]
Reply by Randy Yates June 30, 20142014-06-30
"engrmasood2002" <100558@dsprelated> writes:

>>Randy Yates <yates@digitalsignallabs.com> writes: >>> [...] >>> (Someone else use's LaTeX? Cool!) >> >>Sheesh, "use's" Randy? I don't know what's wrong >>with me; lately I've been hosing up my grammar! >>-- >>Randy Yates >>Digital Signal Labs >>http://www.digitalsignallabs.com >> > > Thanks for all of the comments. > Finally i have done it without shutting down my computer.
So you're satisfied that you finally, after days of questions and multiple codes and erroneous results, managed to get something working that would have taken an undergraduate who studied the theory for two hours could probably get right in 0.5 hours? PAT YOURSELF ON THE BACK! -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Reply by engrmasood2002 June 29, 20142014-06-29
>Randy Yates <yates@digitalsignallabs.com> writes: >> [...] >> (Someone else use's LaTeX? Cool!) > >Sheesh, "use's" Randy? I don't know what's wrong >with me; lately I've been hosing up my grammar! >-- >Randy Yates >Digital Signal Labs >http://www.digitalsignallabs.com >
Thanks for all of the comments. Finally i have done it without shutting down my computer. _____________________________ Posted through www.DSPRelated.com
Reply by Frnak McKenney June 29, 20142014-06-29
On Sat, 28 Jun 2014 10:41:40 -0500, Tim Wescott <tim@seemywebsite.please> wrote:
> On Fri, 27 Jun 2014 18:44:25 -0400, Randy Yates wrote: > >> Randy Yates <yates@digitalsignallabs.com> writes: >>> [...] >>> (Someone else use's LaTeX? Cool!) >> >> Sheesh, "use's" Randy? I don't know what's wrong with me; lately I've >> been hosing up my grammar! > > Time to re-read "Eats, Shoots, & Leaves", or perhaps to put your copy of > Strunk & White under the pillow at night and hope you re-absorb the > wisdom by osmosis.
Then follow it up with this: Spell It Out: The Curious, Enthralling and Extraordinary Story of English Spelling David Crystal http://www.amazon.com/Spell-Out-Enthralling-Extraordinary-Spelling/dp/1250003474/ English, it turns out, is the end result of numerous attempts at regular- ization and simplification... by multiple individuals and groups separated in time and space. Watching the author trace this process is highly entertaining, and the results are about as you might expect, with as many "correct" answers as you get to other "simple" questions like "How do you make bread?" and "How do you design an amplifier?" Enjoy... Frank McKenney -- ...I am convinced that scientists have an obligation to communicate with the public, people who do not know the difference between an anaysis of variance and a factor analysis but who are eager to read about current research findings and the hot controversies in our field. The trick is to inform readers about the latest results in a way that is interesting, but at the same time respect the complexity of the issues and be honest about what we know and what we don't. -- Hal Herzog / Some We Love, Some We Hate, Some We Eat -- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney aatt mindspring ddoott com
Reply by Tim Wescott June 28, 20142014-06-28
On Fri, 27 Jun 2014 18:44:25 -0400, Randy Yates wrote:

> Randy Yates <yates@digitalsignallabs.com> writes: >> [...] >> (Someone else use's LaTeX? Cool!) > > Sheesh, "use's" Randy? I don't know what's wrong with me; lately I've > been hosing up my grammar!
Time to re-read "Eats, Shoots, & Leaves", or perhaps to put your copy of Strunk & White under the pillow at night and hope you re-absorb the wisdom by osmosis. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
Reply by Randy Yates June 27, 20142014-06-27
Randy Yates <yates@digitalsignallabs.com> writes:
> [...] > (Someone else use's LaTeX? Cool!)
Sheesh, "use's" Randy? I don't know what's wrong with me; lately I've been hosing up my grammar! -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Reply by Randy Yates June 27, 20142014-06-27
Tim Wescott <tim@seemywebsite.really> writes:

> On Fri, 27 Jun 2014 09:29:45 -0400, Randy Yates wrote: > >> "engrmasood2002" <100558@dsprelated> writes: >> >>>>On Thu, 26 Jun 2014 13:22:44 -0500, engrmasood2002 wrote: >>>> >>>>> Hi All An SDR Software (SDRSharp) plays the file containing two >>>>> stations one at 0hz and other at 8khz. By Clicking at both the >>>>> stations one by one (FFT Display) stations can be heard. >>>>> I tried to demodulate them in my software and always able to hear >>>>> station at 0Hz after demodulation. even i have shifted 8Khz signal to >>>>> 0Hz but i am able to hear only station that was initially at 0Hz. >>>>> Maybe i am doing something wrong. can any one tell me by looking at >>>>> the code what i am doing wrong >>>>> >>>>> float carrFrq=8000.0; //station to tune and to be shifted to 0Hz >>>>> float LO_Frq=carrFrq; >>>>> float LO_Ph_Inc= ( (2.0*PI*LO_Frq)/FS); >>>>> float LO_ph_acc=0; >>>>> >>>>> float LO_ph_acc=0; // NCO >>>>> for(int a=0; a<samples_count*2;a+=2) >>>>> { >>>>> i = fptr[a]; // fptr contains >>>>I/Q from wave file at 0Hz >>>>> q = fptr[a+1]; >>>>> >>>>> ////tunning test/////////////////////// > LO_ph_acc+=LO_Ph_Inc; >>>>> >>>>> if(LO_ph_acc> (2 * PI) ) >>>>> LO_ph_acc-=(2 * PI); >>>>> >>>>> i*=cos(LO_ph_acc); // shift I/Q >>>>from 8 khz to 0 Hz >>>>> q*=sin(LO_ph_acc); // >>>>> >>>>> final[j++]= 83 * sqrt( (i * i ) + (q * q) ); //demodulate >>>>> } >>>>> >>>>> _____________________________ >>>>> Posted through www.DSPRelated.com >>>> >>>>You are not doing a full complex downconversion. The nomenclature gets >>>>confusing, but for j = sqrt(-1), your received value is a complex >>>>number equal to >>>> >>>>x = i + j*q >>>> >>>>(note that my 'j' is not your index variable in the code above). You >>>>want to multiply it by >>>> >>>>e^(-LO_ph_acc) = cos(LO_ph_acc) - j * sin(LO_ph_acc) >>>> >>>>Do the math, and you should (if I have my head on straight) get: >>>> >>>>fi = i * cos(LO_ph_acc) + q * sin(LO_ph_acc); >>>>fq = q * cos(LO_ph_acc) - q * sin(LO_ph_acc); >>>> >>>>final[j++] = 83 * sqrt((fi * fi) + (fq * fq)); >>>> >>>>Note that the C++ standard library has (if I remember correctly) a >>>>complex data type that'll take care of the arithmetic for you, possibly >>>>in a more efficient manner than you can hand-code it. >>>> >>>>-- >>>> >>>>Tim Wescott Wescott Design Services http://www.wescottdesign.com >>>> >>>> >>>> >>> Tim >>> Thanks for answering my newbie type questions. I am moving in dsp by >>> the help of people like you and trying to implement each block after >>> understanding the concept and then seeing the result programmatically. >>> I am now stuck in Digital Down conversion and even after googling >>> unable to find: >>> >>> 1. Difference between half and full complex down conversion. >>> >>> 2. Which (complex down conversion) is suitable for Frequency >>> translation or tuning given we have I/Q samples. >>> >>> 3.Which (complex down conversion) is suitable for Frequency translation >>> or tuning given we have raw samples and we have to generate base band >>> ((I/Q) for given frequency. >>> >>> 4. Any article with example psuedocode that can be translated in to >>> software (source code). >>> >>> The code for down-conversion i adopted was from saqrx sdr files, if its >>> not correct then i doubt how it works because it uses LO for 16500 hz >>> for signals of interest and multiply signals from sound card ADC to >>> this LO to generate I/Q samples. >>> >>> Thanks >> >> Hello, >> >> It appears to me that you are putting the hart before the corse. >> >> What I suggest is that you shut down your computer, get out a book (Rick >> Lyons' "Understanding Digital Signal Processing" would be good), a >> pencil, and some paper, and read about complex upconversion and >> downconversion. Write out some simple examples by hand. Then I bet a few >> lights will come on. > > That's a good recommendation. I've made some comments in that direction > that were both much snippier and much more obscure. > > I can't imagine going very far in DSP without starting from the math and > going forward from there, although I suppose it could be done. > > I also suggest that when you _do_ fire up the computer and start playing > again, that you install Scilab and use it to test out algorithms. Once > you learn the shortcuts, Scilab makes a much better playground for > verifying math with real-world data than C or C++. > > In case you're curious, my development methodology here is: > > 1: Develop the math on paper (Well, using LaTeX, but that's just paper > with a much better way of erasing). I might use WxMaxima to help with > the symbolic manipulation. > > 2: Prototype the math with Scilab. > > 3: If it needs to go that far, implement the math with C, C++, assembly, > or whatever else works best for the problem at hand.
Agreed. (Someone else use's LaTeX? Cool!) -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Reply by Tim Wescott June 27, 20142014-06-27
On Fri, 27 Jun 2014 09:29:45 -0400, Randy Yates wrote:

> "engrmasood2002" <100558@dsprelated> writes: > >>>On Thu, 26 Jun 2014 13:22:44 -0500, engrmasood2002 wrote: >>> >>>> Hi All An SDR Software (SDRSharp) plays the file containing two >>>> stations one at 0hz and other at 8khz. By Clicking at both the >>>> stations one by one (FFT Display) stations can be heard. >>>> I tried to demodulate them in my software and always able to hear >>>> station at 0Hz after demodulation. even i have shifted 8Khz signal to >>>> 0Hz but i am able to hear only station that was initially at 0Hz. >>>> Maybe i am doing something wrong. can any one tell me by looking at >>>> the code what i am doing wrong >>>> >>>> float carrFrq=8000.0; //station to tune and to be shifted to 0Hz >>>> float LO_Frq=carrFrq; >>>> float LO_Ph_Inc= ( (2.0*PI*LO_Frq)/FS); >>>> float LO_ph_acc=0; >>>> >>>> float LO_ph_acc=0; // NCO >>>> for(int a=0; a<samples_count*2;a+=2) >>>> { >>>> i = fptr[a]; // fptr contains >>>I/Q from wave file at 0Hz >>>> q = fptr[a+1]; >>>> >>>> ////tunning test///////////////////////
LO_ph_acc+=LO_Ph_Inc;
>>>> >>>> if(LO_ph_acc> (2 * PI) ) >>>> LO_ph_acc-=(2 * PI); >>>> >>>> i*=cos(LO_ph_acc); // shift I/Q >>>from 8 khz to 0 Hz >>>> q*=sin(LO_ph_acc); // >>>> >>>> final[j++]= 83 * sqrt( (i * i ) + (q * q) ); //demodulate >>>> } >>>> >>>> _____________________________ >>>> Posted through www.DSPRelated.com >>> >>>You are not doing a full complex downconversion. The nomenclature gets >>>confusing, but for j = sqrt(-1), your received value is a complex >>>number equal to >>> >>>x = i + j*q >>> >>>(note that my 'j' is not your index variable in the code above). You >>>want to multiply it by >>> >>>e^(-LO_ph_acc) = cos(LO_ph_acc) - j * sin(LO_ph_acc) >>> >>>Do the math, and you should (if I have my head on straight) get: >>> >>>fi = i * cos(LO_ph_acc) + q * sin(LO_ph_acc); >>>fq = q * cos(LO_ph_acc) - q * sin(LO_ph_acc); >>> >>>final[j++] = 83 * sqrt((fi * fi) + (fq * fq)); >>> >>>Note that the C++ standard library has (if I remember correctly) a >>>complex data type that'll take care of the arithmetic for you, possibly >>>in a more efficient manner than you can hand-code it. >>> >>>-- >>> >>>Tim Wescott Wescott Design Services http://www.wescottdesign.com >>> >>> >>> >> Tim >> Thanks for answering my newbie type questions. I am moving in dsp by >> the help of people like you and trying to implement each block after >> understanding the concept and then seeing the result programmatically. >> I am now stuck in Digital Down conversion and even after googling >> unable to find: >> >> 1. Difference between half and full complex down conversion. >> >> 2. Which (complex down conversion) is suitable for Frequency >> translation or tuning given we have I/Q samples. >> >> 3.Which (complex down conversion) is suitable for Frequency translation >> or tuning given we have raw samples and we have to generate base band >> ((I/Q) for given frequency. >> >> 4. Any article with example psuedocode that can be translated in to >> software (source code). >> >> The code for down-conversion i adopted was from saqrx sdr files, if its >> not correct then i doubt how it works because it uses LO for 16500 hz >> for signals of interest and multiply signals from sound card ADC to >> this LO to generate I/Q samples. >> >> Thanks > > Hello, > > It appears to me that you are putting the hart before the corse. > > What I suggest is that you shut down your computer, get out a book (Rick > Lyons' "Understanding Digital Signal Processing" would be good), a > pencil, and some paper, and read about complex upconversion and > downconversion. Write out some simple examples by hand. Then I bet a few > lights will come on.
That's a good recommendation. I've made some comments in that direction that were both much snippier and much more obscure. I can't imagine going very far in DSP without starting from the math and going forward from there, although I suppose it could be done. I also suggest that when you _do_ fire up the computer and start playing again, that you install Scilab and use it to test out algorithms. Once you learn the shortcuts, Scilab makes a much better playground for verifying math with real-world data than C or C++. In case you're curious, my development methodology here is: 1: Develop the math on paper (Well, using LaTeX, but that's just paper with a much better way of erasing). I might use WxMaxima to help with the symbolic manipulation. 2: Prototype the math with Scilab. 3: If it needs to go that far, implement the math with C, C++, assembly, or whatever else works best for the problem at hand. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by Tim Wescott June 27, 20142014-06-27
On Fri, 27 Jun 2014 02:32:33 -0500, engrmasood2002 wrote:

>>>On Thu, 26 Jun 2014 13:22:44 -0500, engrmasood2002 wrote: >>> >>>> Hi All An SDR Software (SDRSharp) plays the file containing two >>>> stations one at 0hz and other at 8khz. By Clicking at both the > stations >>>> one by one (FFT Display) stations can be heard. >>>> I tried to demodulate them in my software and always able to hear >>>> station at 0Hz after demodulation. even i have shifted 8Khz signal to >>>> 0Hz but i am able to hear only station that was initially at 0Hz. > Maybe >>>> i am doing something wrong. can any one tell me by looking at the >>>> code what i am doing wrong >>>> >>>> float carrFrq=8000.0; //station to tune and to be shifted to 0Hz >>>> float LO_Frq=carrFrq; >>>> float LO_Ph_Inc= ( (2.0*PI*LO_Frq)/FS); >>>> float LO_ph_acc=0; >>>> >>>> float LO_ph_acc=0; // NCO >>>> for(int a=0; a<samples_count*2;a+=2) >>>> { >>>> i = fptr[a]; // fptr contains >>>I/Q from wave file at 0Hz >>>> q = fptr[a+1]; >>>> >>>> ////tunning test///////////////////////
LO_ph_acc+=LO_Ph_Inc;
>>>> >>>> if(LO_ph_acc> (2 * PI) ) >>>> LO_ph_acc-=(2 * PI); >>>> >>>> i*=cos(LO_ph_acc); // shift I/Q >>>from 8 khz to 0 Hz >>>> q*=sin(LO_ph_acc); // >>>> >>>> final[j++]= 83 * sqrt( (i * i ) + (q * q) ); //demodulate >>>> } >>>> >>>> _____________________________ >>>> Posted through www.DSPRelated.com >>> >>>You are not doing a full complex downconversion. The nomenclature gets >>>confusing, but for j = sqrt(-1), your received value is a complex >>>number > >>>equal to >>> >>>x = i + j*q >>> >>>(note that my 'j' is not your index variable in the code above). You >>>want to multiply it by >>> >>>e^(-LO_ph_acc) = cos(LO_ph_acc) - j * sin(LO_ph_acc) >>> >>>Do the math, and you should (if I have my head on straight) get: >>> >>>fi = i * cos(LO_ph_acc) + q * sin(LO_ph_acc); >>>fq = q * cos(LO_ph_acc) - q * sin(LO_ph_acc); >>> >>>final[j++] = 83 * sqrt((fi * fi) + (fq * fq)); >>> >>>Note that the C++ standard library has (if I remember correctly) a >>>complex data type that'll take care of the arithmetic for you, possibly >>>in a more efficient manner than you can hand-code it. >>> >>>-- >>> >>>Tim Wescott Wescott Design Services http://www.wescottdesign.com >>> >>> >>> >> Tim >>Thanks for answering my newbie type questions. I am moving in dsp by the >>help of people like you and trying to implement each block after >>understanding the concept and then seeing the result programmatically. >>I am now stuck in Digital Down conversion and even after googling unable > to >>find: >> >>1. Difference between half and full complex down conversion. >> >>2. Which (complex down conversion) is suitable for Frequency translation > or >>tuning given we have I/Q samples. >> >>3.Which (complex down conversion) is suitable for Frequency translation > or >>tuning given we have raw samples and we have to generate base band >>((I/Q) >>for given frequency. >> >>4. Any article with example psuedocode that can be translated in to >>software (source code). >> >>The code for down-conversion i adopted was from saqrx sdr files, if its > not >>correct then i doubt how it works because it uses LO for 16500 hz for >>signals of interest and multiply signals from sound card ADC to this LO > to >>generate I/Q samples. >> >>Thanks >> >> >> >>_____________________________ >>Posted through www.DSPRelated.com >> >> > I just found a good article at > http://www.cs.tut.fi/kurssit/TLT-9707/presentations/Complex-Signals-and-
Radios-short-2pp.pdf
> > and example for down coversion described in the down-conversion figure > for Complex signals lead me to these equations for frequency translation > but still no luck. > > LO_ph_acc+=LO_Ph_Inc; > > if(LO_ph_acc> (2 * PI) ) > LO_ph_acc-=(2 * PI); > > i=(i * cos(LO_ph_acc)) - (q* sin
(LO_ph_acc));
> q=(i* sin(LO_ph_acc)) + (q* cos
(LO_ph_acc)); You modify i, then use the modified i to calculate q. That's why I changed the variable names in my example. That's also why -- if you're working in C++, it's nice to use a complex library that takes care of those nits for you with pre-tested code. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com