当前位置:   article > 正文

MATLAB 对信号进行butter带通滤波

MATLAB 对信号进行butter带通滤波

发送三个波,波特率2G,中心频率分别是2G 6G和10G,现在做一个带通的滤波器滤出10G的波,4阶带通开始8G,截止10G,采样率64G

[B,A]=butter(4,[8e9/(SampleRate/2) 12e9/(SampleRate/2)]);
SpectrumAnalyzer(RxWfmTemp,'fs',64)
freqz(B,A)
RxWfmTemp=filter(B,A,RxWfmTemp);

 

 

  1. close all;
  2. clear;
  3. %% parameter
  4. RollOff = 0.1;
  5. N_T = 100;
  6. SampleRate = 64e9;
  7. BaudRate = 2e9;
  8. UpRate = SampleRate / BaudRate;
  9. Len = 8192;
  10. TrainLen = 2048;
  11. rand('seed', 15);
  12. TxBit = randi([0 1],1, Len);
  13. TxSym = qammod(TxBit.', 2, 'InputType', 'Bit').'; %BPSK
  14. %% upsampling & RRC
  15. RRCFilt = rcosdesign(RollOff, N_T, UpRate, 'sqrt');
  16. TxWfm=upfirdn(TxSym,RRCFilt,UpRate,1);
  17. %% Frequency offset emulation
  18. FreOffReal1 = 2*1e9; % unknown to the receiver Hz
  19. RxWfm1 = TxWfm.*exp(1i*2*pi*FreOffReal1*[1:length(TxWfm)]/BaudRate/UpRate);
  20. FreOffReal2 = 6*1e9; % unknown to the receiver Hz
  21. RxWfm2 = TxWfm.*exp(1i*2*pi*FreOffReal2*[1:length(TxWfm)]/BaudRate/UpRate);
  22. FreOffReal3 = 10*1e9; % unknown to the receiver Hz
  23. RxWfm3 = TxWfm.*exp(1i*2*pi*FreOffReal3*[1:length(TxWfm)]/BaudRate/UpRate);
  24. RxWfm_Orin = RxWfm1+RxWfm2+RxWfm3;
  25. signalF = fftshift(fft(RxWfm_Orin));
  26. fs=(-length(RxWfm_Orin)/2+1:length(RxWfm_Orin)/2)*SampleRate/length(RxWfm_Orin);
  27. figure(1)
  28. plot(fs,10*log10(abs(signalF)));
  29. grid on
  30. title('滤波前')
  31. %% filter
  32. RxWfmTemp = RxWfm_Orin;
  33. [B,A]=butter(4,[8e9/(SampleRate/2) 12e9/(SampleRate/2)]);
  34. SpectrumAnalyzer(RxWfmTemp,'fs',64)
  35. freqz(B,A)
  36. RxWfmTemp=filter(B,A,RxWfmTemp);
  37. signalF = fftshift(fft(RxWfmTemp));
  38. fs=(-length(RxWfm_Orin)/2+1:length(RxWfm_Orin)/2)*SampleRate/length(RxWfm_Orin);
  39. figure(2)
  40. plot(fs,10*log10(abs(signalF)));
  41. grid on
  42. title('滤波后')

但是这个解调是错的,之后再改

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号