Why i am not getting my message signal as output ?
조회 수: 2 (최근 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!