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
SO what is R how do I set it then R fro mwhat I made it is not negative.? Please help and the examples do not have pll. Please hel pso by looking at my code what is going on why am i geting an error at the last line? Thanks guys