⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsk_4.m

📁 卫星信道中的调制识别的matlab仿真分析
💻 M
字号:
function y=fsk_4(snr_in); 
snr=10^(snr_in/10);
x=rand(100,1);
h=length(x);
fc=10000;fs=100000;
ts=10/fc;t=0:1/fs:ts*h-1/fs;l=length(t)/h;
t=reshape(t',l,h);t=t';
y=zeros(h/2,l);
for i=1:h,
        if x(i)>=0.5
            x(i)=1;
        else x(i)=0;
        end
end
for i=1:2:h,
    z(i)=x(i)*2+x(i+1);
end
for i=1:h/2,    
   switch z(i)
       case 3, y(i,:)=sin(2*pi*fc.*t(i,:));
       case 2, y(i,:)=sin(4*pi*fc.*t(i,:));
       case 1, y(i,:)=sin(8*pi*fc.*t(i,:));
       otherwise  y(i,:)=sin(16*pi*fc.*t(i,:));
   end
end
y0=reshape(y',l*h/2,1);
power=y0'*y0;
powerzao=power/snr;%以下是产生高斯白噪声序列
a=sqrt(powerzao/(l*h));
zao=a*randn(l*h/2,1);
powerzao2=zao'*zao;
y=y0+zao;%加噪以后的信号
t=0:1/fs:ts*h/2-1/fs;
t=reshape(t',l*h/2,1);
subplot(311);plot(t,y);
title('4FSK信号的时域图形')
%p=abs(fft(y,l*h/2));
%k=1:5000;
%subplot(312);plot(k,p(k));
%title('4FSK信号的频谱图')
grid on

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -