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
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 CenterFile Exchange 中查找有关 Filter Design 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by