Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Define Matlab code (FM demodulation)

Status
Not open for further replies.

yiyi87

Newbie level 5
Joined
Jul 9, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Malaysia
Activity points
1,344
fm circuits with matlab output

Hi, I have a matlab code here
it acquires FM modulated signal from sound card can perform FM demodulation
however, i don't why it set vcok (VCO K constant) at 0.176
anyone can explain to me how and why it is set to 0.176?

Fc = 2144; %select VCO carrier frequency
vcok = 0.176; %select vco constant
Fs = 40000; %select sound card sampling frequency
samptime = 3; %select sampling time (in seconds)
y = wavrecord(samptime*Fs, Fs, 'double'); %sample sound into y
wavplay(y, Fs); %play the recorded sound
x = (demod(y, Fc, Fs, 'fm', vcok)); %FM demodulate the sound
cutoff = 100/(Fs/2); %cutoff(1/2 sampling frequency)
[b, a] = butter(4,cutoff); %design butterworth low pass filter
xfilt = filter(b,a,x); %filter demodulation signal
time = 1/Fs:(1/Fs):samptime; %generate time vector
figure, plot(time,xfilt) %plot filtered data vs time
grid %overlay grid on plot
xlabel ('time ') %label x axis
ylabel ('input [volts]') %label y axis

thank you in advance
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top