`Hi guys I really need help designing FM system using PLL as a`

demodulation. I have matlab code below and it is not working at the

filtering end am I doing everything right? I basically how do I set

the filter up to work? The way I set this up would be a PLL as a

demodulation right? THanks guys

[Y,Fs,NBITS,OPTS] = mp3read('jem.mp3');

snd=Y(1:300000);

t = 0:1/Fs:(length(snd)-1)/Fs;

plot(t,snd);

%Modultaion

Ac=5;

fc 000;

wc=2*pi*fc;

kf = (fc/Fs)*(2*pi)/(max(max(abs(snd))));

outfm = Ac * cos(wc.*t + 2 * pi * kf * cumsum(snd));

%noise

Mp = max(snd); % Calculating the frequency deviation constant of the modulation.

deviation = kf*Mp;

% Demodulating the signal.

Defreq= ademod(outfm,fc,Fs,'fm',deviation);

Wn = .95;

% Designing butterworth band pass filter.If Wn is a two-element

vector with

% w1 < w2, butter(n,Wn,'s') returns an order 2*n bandpass analog

filter

% with passband w1 < < w2.

% [b,a] = butter(n,Wn,'ftype','s') designs a highpass or bandstop

filter

[num,den] = butter(2,Wn,'high');

output = filter(num,den,Defreq);

demodulation. I have matlab code below and it is not working at the

filtering end am I doing everything right? I basically how do I set

the filter up to work? The way I set this up would be a PLL as a

demodulation right? THanks guys

[Y,Fs,NBITS,OPTS] = mp3read('jem.mp3');

snd=Y(1:300000);

t = 0:1/Fs:(length(snd)-1)/Fs;

plot(t,snd);

%Modultaion

Ac=5;

fc 000;

wc=2*pi*fc;

kf = (fc/Fs)*(2*pi)/(max(max(abs(snd))));

outfm = Ac * cos(wc.*t + 2 * pi * kf * cumsum(snd));

%noise

Mp = max(snd); % Calculating the frequency deviation constant of the modulation.

deviation = kf*Mp;

% Demodulating the signal.

Defreq= ademod(outfm,fc,Fs,'fm',deviation);

Wn = .95;

% Designing butterworth band pass filter.If Wn is a two-element

vector with

% w1 < w2, butter(n,Wn,'s') returns an order 2*n bandpass analog

filter

% with passband w1 < < w2.

% [b,a] = butter(n,Wn,'ftype','s') designs a highpass or bandstop

filter

[num,den] = butter(2,Wn,'high');

output = filter(num,den,Defreq);