Why i am not getting my message signal as output ?
1 回表示 (過去 30 日間)
古いコメントを表示
This is my code for Am demodulation.I am not getting my signal "y" as output.why i am not getting ?
clear all;
clc;
Fs = 6000;
fc=1000;
f_del=100;
fm=500;
t1=0:1/Fs:1-1/Fs;
Am=2;
Ac=5;
x1=cos(2*pi*(fc+f_del)*t1);
y=cos(2*pi*fm*t1);
z1=x.*y;
a1=z1.*x1*Ac;
y3=cos(2*pi*f_del*t1);
lpFilt = designfilt('lowpassfir', 'PassbandFrequency', 0.1667,...
'StopbandFrequency', 0.2167, 'PassbandRipple', 0.02, ...
'StopbandAttenuation', 85, 'DesignMethod', 'kaiserwin');
dataout1=filter(lpFilt,a1);
DCB=dsp.DCBlocker('Algorithm','FIR','Length', 100);
demodout1=step(DCB,dataout1'); %% demodout1= y.*cos(2*pi*f_del*t)=y.*y3
demodout2=(demodout1)'./y3;
output should be "y" but not coming...
2 件のコメント
per isakson
2019 年 11 月 25 日
I got the error
Undefined function or variable 'x'.
Error in cssm (line 12)
z1=x.*y;
then I replaced x by x1 in line 12 and the code run happily to the end
>> whos y x1
Name Size Bytes Class Attributes
x1 1x6000 48000 double
y 1x6000 48000 double
The variable y was defined
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Filter Design についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!