資源簡(jiǎn)介
FSK的調(diào)制和解調(diào),通過濾波,判決后得到輸出信號(hào)。從頻域和時(shí)域上都進(jìn)行了詳細(xì)的分析。
代碼片段和文件信息
clear?all;
clc;
%2FSK調(diào)制
Fs=20;???%插入的個(gè)數(shù)
f1=2;????%對(duì)應(yīng)1
f2=6;????%對(duì)應(yīng)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(‘基帶信號(hào)‘);
grid;
subplot(222);
plot(fabs(fftshift(X)));
title(‘基帶信號(hào)頻譜‘);
grid;
subplot(223);
plot(tytx‘-r‘);
title(‘2FSK信號(hào)‘);
grid;
subplot(224);
plot(fabs(fftshift(Y)));
title(‘2FSK信號(hào)頻譜‘);
grid;
%加入噪聲
figure(2)
snr=20;
y=awgn(ysnr);
plot(y);
title(‘加入噪聲后的信號(hào)‘);
xlabel(‘t‘);
ylabel(‘Amplitude‘);
%相干解調(diào)
fp1=[13];
fs1=[0.53.5];
fp2=[57];
fs2=[4.57.5];
wp1=fp1/(Fs/2);
ws1=f
評(píng)論
共有 條評(píng)論