% Demodulation demodulated_signal = modulated_signal .* c; % Low-pass filter (to remove high-frequency components) cutoff_freq = 2 * fm; % Cut-off frequency [b, a] = butter(6
2 次查看(过去 30 天)
显示 更早的评论
modulation
demodulation
1 个评论
回答(1 个)
William Rose
2023-12-24
Suppose the original signal is a 17 Hz sine wave plus a 23 Hz cosine wave, 0.2 seconds long, plus an offset so it is always positive:
fs=1e4; % sampling rate (Hz)
t=0:1/fs:0.2; % time (s)
y=2+sin(2*pi*17*t)+cos(2*pi*23*t); % original signal
Suppose the carrier wave frequency is 1 kHz.
fcarrier=1000; % carrier freq (Hz)
c=cos(2*pi*fcarrier*t); % carrier wave
Choose a modulation index, M, so that the modulating signal stays non-negative:
M=1/max(abs(y)); % modulation index
Use y to amplitude-modulate the carrier. Call the AM signal x.
x=y.*c*(1+M); % A.M. signal
Plot what you have so far:
figure; subplot(211); plot(t,y,'-r'); grid on; title('Original Signal')
subplot(212); plot(t,x,'-g'); grid on; title('A.M. Signal'); xlabel('Time (s)')
Your original signal and carrier frequency will be different, but the code above gets you started.
Now let's try to extract y, from x. In other words, demodulate the AM signal.
You can take it from here. Define a lowpass filter with an appropriate cutoff frequency. Rectify y (i.e. take its absolute value) and then apply the lowpass filter to it. You could use Matlab's filter() or filtfilt(). Read the help for filter() or filtfilt(). Good luck.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filtering 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!