Clear Filters
Clear Filters

FM Demodulation creates huge spikes of high frequencies.

2 views (last 30 days)
[x,Fs]=audioread("recording-file.m4a");
T = 1/Fs;
t=0:T:length(x)/Fs-T;
FM = 10.7*10^6;
Fs2 = (10.7*12)*10^6;
fvar = 3.5*10^3;
modulated = fmmod(x,FM,Fs2,fvar);
figure,plot(t,modulated),grid on, xlabel("tiempo"), ylabel("amplitud"), title("S. modulada")
demod = fmdemod(modulated,FM,Fs2,fvar);
figure,plot(t,demod),grid on, xlabel("tiempo"), ylabel("amplitud"), title("S. demodulada")

Answers (1)

Abhijeet
Abhijeet on 4 Apr 2023
Edited: Abhijeet on 4 Apr 2023
Hi,
It looks like the issue might be related to aliasing. When you modulate the signal, you are increasing the frequency range of the signal, which means that you need to increase the sampling rate to avoid aliasing. However, in your code, you are not increasing the sampling rate when you perform the demodulation.
To fix this, you can try increasing the sampling rate when you perform the demodulation, by setting Fs2 to a higher value than FM. For example, you can try setting Fs2 to 2 times the maximum frequency in the modulated signal, which can be computed as 2*(FM + fvar).
Here's the modified code:
[x,Fs]=audioread("recording-file.m4a");
T = 1/Fs;
t=0:T:length(x)/Fs-T;
FM = 10.7*10^6;
Fs2 = 2*(FM + fvar); % increase the sampling rate for demodulation
fvar = 3.5*10^3;
modulated = fmmod(x,FM,Fs2,fvar);
figure,plot(t,modulated),grid on, xlabel("tiempo"), ylabel("amplitud"), title("S. modulada")
demod = fmdemod(modulated,FM,Fs2,fvar);
figure,plot(t,demod),grid on, xlabel("tiempo"), ylabel("amplitud"), title("S. demodulada")
I hope this resolves your issue.
Thanks !!
  1 Comment
Jaime
Jaime on 12 Apr 2023
Hi, in your code the demodulation is using the same Fs2 as for modulation. But I tried increasing it and it it not help.

Sign in to comment.

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!