%by this file i have to take a music file of duration 20 sec, and perform
%frequency modulation and demodulation, and hearing both the musics.
%santosh shah, The LNM IIT Jaipur (India)(email@example.com) 20/04/07
fsamp = 100e3; %sampling frequency taken 44kHz.
B = 10000; A =1 ; C = 0; fcarr = 10e3; Down_samp =2;
test_data = 'E:\MATLAB\SDR_course\october31\my_speech.wav';
siz = wavread(test_data, 'size');
[data, fcar] = wavread(test_data);
x = 5*[data]' ; % coulnm to row vector conversion
% plot in time and frequency domain.
%tfplot(x, fcar, 'Vmusic', 'Music for test');
%now calling the function ammod for modulating the music.
s= my_fmmod(x, A, B, C, fcarr, fsamp);
% plot both messege and modulate d signal
tfplot(x, fsamp, 'Vmusic', 'music signal');
tfplot(s, fsamp, 'Vfm', 'modulated signal');
% now i am going to demodulate the original music
s_demod = my_fmdemod(s, fcarr, fsamp);
%ploting the original signal and its spectrum
tfplot(s_demod, fsamp, 'Vmusic', 'recovered music signal');
sound(downsample(s_demod,Down_samp), fcar / Down_samp);