DSPRelated.com
Forums

Create FM stereo from Matlab.

Started by disney_snoopy November 18, 2009
Randy Yates wrote:
> disney_snoopy <disney_snoopy@hotmail.com> writes: > >> On Nov 30, 1:42 pm, Randy Yates <ya...@ieee.org> wrote: >>> glen herrmannsfeldt <g...@ugcs.caltech.edu> writes: >>>> disney_snoopy <disney_sno...@hotmail.com> wrote: >>>>> my input audio signal is 1kHz and my sampling freq is 200kHz. >>>>> Please help! >>>> Generate sum and difference, generate pilot signal, generate AMSC >>>> subcarrier with the appropriate phase, add all three together. >>>> A little more complicated since 200 isn't a multiple of 38. >>> glen, even his specification is incomplete. The input audio should >>> be STEREO, i.e., left and right. >>> -- >>> Randy Yates % "Maybe one day I'll feel her cold embrace, >>> Digital Signal Labs % and kiss her interface, >>> mailto://ya...@ieee.org % til then, I'll leave her alone."http://www.digitalsignallabs.com% 'Yours Truly, 2095', *Time*, ELO >> Hi Glen and Randy, >> >> This is my DSP project. >> what i am doing is use a software to prove the FM stereo is work which >> i >> can get the outlook structure to this FM stereo broadcast. After get >> the >> FM stereo structured, apply an audio frequency to this FM stereo and >> calculate out the THD. >> >> What i know from here is the L+R region is 50Hz to 15kHz. How to >> implement >> it to the Matlab i really no idea. Hence, now im finding for help or >> comment on which command i should use to implement the L+R region. >> I tried to use multiband coding for this region but i found that i >> cant code my pilot frequency. >> The only thing that i can do in this Matlab now is only the pilot >> freq. >> >> So now do you all get what i mean and what i want? > > Not really. I'm not good at inferring meaning from poorly-constructed > sentences. > > However, I'm almost positive that if you read this: > > http://en.wikipedia.org/wiki/FM_broadcasting#Modulation_characteristics > > and can really understand it, especially the section entitled "FM > stereo," then you will have answered many of your own questions. > > It seems you've put the cart before the horse and you are trying > to implement a system that you really don't understand - that will > never work.
I have to second that on the evidence that L+R is the mono signal that any receiver will pick up. The multiplexed part riding on the 38 KHz carrier is L-R. Stereo vinyl disks are the same way. L+R is the horizontal movement of the stylus that a mono player will respond to, while L-R is the encoded in vertical motion. That's what makes it _compatible_ stereo. 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;
Jerry Avins <jya@ieee.org> wrote:
(snip)
 
> I have to second that on the evidence that L+R is the mono signal that > any receiver will pick up. The multiplexed part riding on the 38 KHz > carrier is L-R. Stereo vinyl disks are the same way. L+R is the > horizontal movement of the stylus that a mono player will respond to, > while L-R is the encoded in vertical motion. That's what makes it > _compatible_ stereo.
The story I remember being that horizontal motion for mono records (vinyl now, but I believe originally something else) such that bearing noise was not picked up. Somehow that problem was solved before stereo came out. The other description is that one wall of the groove has the left channel, the other the right channel. As I understand it, the record cutters use L+R and L-R, but playback is done L and R with the appropriate coordinate rotation. Also, FM stereo is described with the 38kHz subcarrier, but, since the amplitude of the subcarrier is just right, also as switching between the two channels at 38kHz. (Filter out any higher order components.) With a sample rate a multiple of 38kHz it would be especially easy to generate the signal. -- glen
In article <6748e7fe-9cbe-408f-8fa9-
ff1105bf8260@g22g2000prf.googlegroups.com>, disney_snoopy@hotmail.com 
says...
> > >Hi all, > >I would appreciate if anyone here could help me. >I was thinking to create a FM stereo with the RDS and L+R and L-R >channel in Matlab. >But i doesnt know how to do on that... >Can anyone here help me plz? > >Thankz
(use a monospaced font for the text below) The FM stereo encoding equation, where w = 2 pi 38000 is: #1: comp(L, R) := (L + R) + (L - R)&#4294967295;COS(w&#4294967295;t) + 0.09&#4294967295;COS(w/2&#4294967295;t) The decoding equations using synchronous demodulation are: #2: Lout = comp(L, R)&#4294967295;(0.5 + COS(w&#4294967295;t)) #3: Rout = comp(L, R)&#4294967295;(0.5 - COS(w&#4294967295;t)) Substituting #1 into #2 and #3 and simplifying gives: ( 3&#4294967295;w&#4294967295;t ) ( w&#4294967295;t ) 9&#4294967295;COS(-------) 9&#4294967295;COS|-----| #4: ( 2 ) ( 2 ) (L - R)&#4294967295;COS(2&#4294967295;w&#4294967295;t) Lout = ---------------- + -------------- + -------------------- + 200 100 2 (3&#4294967295;L + R)&#4294967295;COS(w&#4294967295;t) -------------------- + L 2 ( 3&#4294967295;w&#4294967295;t ) 9&#4294967295;COS|-------| #5: ( 2 ) (R - L)&#4294967295;COS(2&#4294967295;w&#4294967295;t) Rout = - ---------------- + -------------------- - 200 2 (L + 3&#4294967295;R)&#4294967295;COS(w&#4294967295;t) -------------------- + R 2 This shows that L and R appear in the outputs of the synchronous demodulator as desired, but there are a number of other terms as well. Assuming that L and R are spectrally limited to less than 19 kHz, L and R can be separated from the remaining terms by applying lowpass filters to #4 and #5 because in this case, the lowest spectral component of the "other terms" is 19 kHz. Typically, the lopwass filters used have a passband to 15 kHz and a stopband beginning at 19 kHz, but nothing in the physics of the system prevents audio response to 19 kHz - (some very small delta). As for the MATLAB implementation of the above, this is an "exercise for the reader."
On Wednesday, November 18, 2009 at 5:07:45 PM UTC-8, disney_snoopy wrote:
> Hi all, > > I would appreciate if anyone here could help me. > I was thinking to create a FM stereo with the RDS and L+R and L-R > channel in Matlab. > But i doesnt know how to do on that... > Can anyone here help me plz? > > Thankz
On Thursday, November 19, 2009 at 2:07:45 PM UTC+13, disney_snoopy wrote:
> Hi all, > > I would appreciate if anyone here could help me. > I was thinking to create a FM stereo with the RDS and L+R and L-R > channel in Matlab. > But i doesnt know how to do on that... > Can anyone here help me plz? > > Thankz
You need a VCO to generate the FM - one for each channel. Like cos(wct+betasin(wmt)) if it was a cosine wave. If you are not careful you will generate phase modulation and not FM. You need an integrator for the baseband signal before modulation I think. Demodulation is easy - use a PLL on MATLAB. You may also want to do pre-emphasis etc