AM Demodulation code error

2 ビュー (過去 30 日間)
Matt
Matt 2023 年 12 月 14 日
コメント済み: Image Analyst 2023 年 12 月 14 日
f_lo = 30e3; % frequency of local oscillator
A_lo = 1; % amplitude of local oscillator
y_lo = A_lo*sin(2*pi*f_lo*time');
y_demod = y_lo.*filt_received;
demod_sig_FD = fft(y_demod); % calculate frequency domain of audio
demod_sig_FD_amp = abs(demod_sig_FD)/no_of_pnts; % calculate the amplitude of frequency domain
demod_sig_FD_amp_adj = fftshift(demod_sig_FD_amp); % adjust the frequency sides
figure;
semilogy(freq, filt_rec_sig_FD_amp_adj, 'b');
hold on;
semilogy(freq, demod_sig_FD_amp_adj, 'r');
xlim([10, freq_max]);
grid minor;
box on;
xlabel('Frequency (Hz)');
ylabel('Amplitude');
legend('Filtered Received', 'Demodulated');
title('Frequency Domain of Filtered Received and Demodulated Signals');
Error is y_demod = y_lo.*filt_received;
Arrays have incompatible sizes for this operation.
  2 件のコメント
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 12 月 14 日
These vars are not given: time, filt_received, no_of_pnts, freq, filt_rec_sig_FD_amp_adj
Image Analyst
Image Analyst 2023 年 12 月 14 日
This is a duplicate post. I already have an Answer posted in the other one.
Are they 100% duplicates, or is one somehow better than the other? Regardless, the answer I started there is still valid.
Which one do you want to continue the conversation in? I can delete the other one.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by