locchamp
Member level 2
fm demodulation matlab
Hi guys can you please help me i am simulating an fm system here is the code below I am having a problem on the demodulation side I am trying to demodulate using PLL desgning (Phase Lock Loop). But it is giving me an error at last line R has to be positive number I think its R please help I am giving up
[Y,Fs,NBITS,OPTS] = mp3read('jem.mp3');
snd=Y(1:200000);
t = 0:1/Fslength(snd)-1)/Fs;
plot(t,snd);
%Modultaion
Ac=1;
fc=68000;
wc=2*pi*fc;
kf=1000;
spc=8;
R = (fc*spc)/Fs;
outfm = Ac * cos(wc.*t + 2 * pi * kf * cumsum(snd));
%noise
%demodulation
z = ademod(FMmodcarrier,fc,fc*spc,'fm'); % PLL-based FM demodulation
dd=decimate(z,R);
this is the problem her I think though it is somehting to do with R is has to be any idea please help thank you so much
Hi guys can you please help me i am simulating an fm system here is the code below I am having a problem on the demodulation side I am trying to demodulate using PLL desgning (Phase Lock Loop). But it is giving me an error at last line R has to be positive number I think its R please help I am giving up
[Y,Fs,NBITS,OPTS] = mp3read('jem.mp3');
snd=Y(1:200000);
t = 0:1/Fslength(snd)-1)/Fs;
plot(t,snd);
%Modultaion
Ac=1;
fc=68000;
wc=2*pi*fc;
kf=1000;
spc=8;
R = (fc*spc)/Fs;
outfm = Ac * cos(wc.*t + 2 * pi * kf * cumsum(snd));
%noise
%demodulation
z = ademod(FMmodcarrier,fc,fc*spc,'fm'); % PLL-based FM demodulation
dd=decimate(z,R);
this is the problem her I think though it is somehting to do with R is has to be any idea please help thank you so much