Stuck in demodulation of AM
2 次查看(过去 30 天)
显示 更早的评论
I am working on a Amplitude modulation and Demodulation But i have facing trouble in only demodulation using RC low pass Filter I have upload my code and also required results picture
clear all;
close all;
t1 = [0:0.001:10];
Ac=1; fc =10; fm=1; C = 1.5;
carrier = Ac*sin(2*pi*fc*t1); % Carrier signal, Ac and fc are amplitude and frequency
message = sin(2*pi*fm*t1); % Modulating signal, fm is message frequency
am = Ac*(C + message).*carrier; % am is Modulated signal first method
%am = ammod(message,fc,2*fc); % am is Modulated signal second method
r = abs(am); % Rectified Signal
% [num,den] = butter(1,fc*2/fm); % Lowpass filter
% s1 = amdemod(am,fc,fm,0,0,num,den); % Demodulate
figure(1);
subplot(3,1,1) plot(t1, message); title('Original Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
subplot(3,1,2) plot(t1, carrier); title('Carrier Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
subplot(3,1,3) plot(t1, am); title('AM Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
figure(2);
subplot(3,1,1) plot(t1, r); title('Rectified Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
subplot(3,1,2) plot(t1, s1); title('Demodulated Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
picture of required waveform

2 个评论
Star Strider
2016-4-23
I don’t have the Communications System Toolbox so I won’t list this as an Answer, since I can’t run your code.
It seems that your demodulated signal simply has high-frequency noise. I would re-design your low-pass filter, either to have a lower cutoff frequency or a sharper cutoff (higher order). I would also use the filtfilt function if you have the Signal Processing Toolbox (or if the Communications System Toolbox has it or a version of it, since it is phase-neutral).
Palempalle Pavan Kumar Reddy
2021-1-29
yes, It's doesn't working fine showing error like ..
Error using butter (line 58)
The cutoff frequencies must be within the interval of (0,1).
Error in goona (line 13)
[num,den] = butter(2,fc*2/fm)
回答(1 个)
Mathieu NOE
2021-1-29
hello
you should use a bandpass filter to remove the DC value of the rectified signal
clear all;
close all;
Fs = 1000;
dt = 1/Fs;
t1 = [0:dt:10];
Ac=1;
fc =10;
fm=1;
C = 1.5;
carrier = Ac*sin(2*pi*fc*t1); % Carrier signal, Ac and fc are amplitude and frequency
message = sin(2*pi*fm*t1); % Modulating signal, fm is message frequency
am = Ac*(C + message).*carrier; % am is Modulated signal first method
%am = ammod(message,fc,2*fc); % am is Modulated signal second method
r = abs(am); % Rectified Signal
% filter
f_high = 2*fm;
f_low = 0.5*fm;
[num,den] = butter(2,[f_low f_high]*2/Fs); % Lowpass filter
% s1 = amdemod(am,fc,fm,0,0,num,den); % Demodulate
s1 = filter(num,den,r);
figure(1);
subplot(3,1,1),plot(t1, message); title('Original Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
subplot(3,1,2),plot(t1, carrier); title('Carrier Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
subplot(3,1,3),plot(t1, am); title('AM Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
figure(2);
subplot(2,1,1),plot(t1, r); title('Rectified Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
subplot(2,1,2),plot(t1, s1); title('Demodulated Signal'); xlabel('Time'); ylabel('Amplitude'); grid on;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!