BPSK Matlab仿真

Matlab仿真与数字逻辑器件实现有一定的类似之处,都是对离散数字信号进行一定的处理。在用FPGA进行数字逻辑设计之前最好能用Matlab进行一些仿真,可以预估中间信号波形为设计做参考,亦可以对方案可行性做分析。

   BPSK原理较为简单,这里只上传代码

 

fs=10000;
fc=1500;
a1=ones(1,10);
a0=zeros(1,10);
b=[a1,a1,a1,a1,a0,a0,a1,a1,a0,a1];%signal:[1 0 1 1 0 0 1 1 0 1]

grid on;
N=20;
d=repmat(b,1,N);
c=2*d-1;
fun8=conv(c,Num);
  plot(fun8);
 axis([100 800 -2 2]);
   grid on ; 

 fft1=fft(c);
%plot(-fs/2+(0:N*100-1)*fs/(N*100),fftshift(abs(fft1)));

cos1=cos(2*pi*fc/fs*[0:N*100-1]);
% plot(cos1);
% axis([1 100 -2 2]);
% grid on ;
 fun1=c.*cos1;
%   plot(fun1);
% axis([1 100 -2 2]);
%   grid on ;
 fun2=fun1.*cos1;
fft1=fft(fun1);
plot(-fs/2+(0:N*100-1)*fs/(N*100),fftshift(abs(fft1)));

 fun3=conv(fun2,Num);
%   plot(fun3);
%  axis([500 800 -2 2]);
%    grid on ; 

  fun4=zeros(1,length(fun3));
 for  m=1:length(fun3)
   if fun3(m)>0
       fun4(m)=1;
   else
       fun4(m)=0;
   end
 end
 fun5= fun4(1:10:length(fun4));
 % stairs([1:10:length(fun5)*10],fun5);
    
 % axis([1500 2000 -0.5 1.5]);
 %  grid on 

  • 3
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值