資源簡介
FSK的調制和解調,通過濾波,判決后得到輸出信號。從頻域和時域上都進行了詳細的分析。
代碼片段和文件信息
clear?all;
clc;
%2FSK調制
Fs=20;???%插入的個數
f1=2;????%對應1
f2=6;????%對應0
ts=1/Fs;
fd=1;
code=randint(120);
[xm]=pulse(codeFsfd);%插入,得到矩形波
t=ts:ts:length(code);
x1=(x-1);
x1=-x1;
y=x.*cos(2*pi*f1*t)+x1.*cos(2*pi*f2*t);
X=fft(x);
Y=fft(y);
n=length(x);
f=[0:Fs/n:Fs-Fs/n]-Fs/2;%表示f是從[-106],間隔為4
figure(1)
subplot(221);
plot(x);
axis([0?length(x)?-1?2]);
title(‘基帶信號‘);
grid;
subplot(222);
plot(fabs(fftshift(X)));
title(‘基帶信號頻譜‘);
grid;
subplot(223);
plot(tytx‘-r‘);
title(‘2FSK信號‘);
grid;
subplot(224);
plot(fabs(fftshift(Y)));
title(‘2FSK信號頻譜‘);
grid;
%加入噪聲
figure(2)
snr=20;
y=awgn(ysnr);
plot(y);
title(‘加入噪聲后的信號‘);
xlabel(‘t‘);
ylabel(‘Amplitude‘);
%相干解調
fp1=[13];
fs1=[0.53.5];
fp2=[57];
fs2=[4.57.5];
wp1=fp1/(Fs/2);
ws1=f
- 上一篇:圖像與視頻處理-傅里葉變換實驗.doc
- 下一篇:pie數據集matlab版本
評論
共有 條評論