• 大小: 5KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-23
  • 语言: Matlab
  • 标签: 升余弦  

资源简介

clear all; close all; fd=1e3; fs=fd*10; delay=5; %分别求四种情况下的升余弦函数 num1=rcosine(fd,fs,'fir/normal',0,delay); num2=rcosine(fd,fs,'fir/normal',0.5,delay); num3=rcosine(fd,fs,'fir/normal',0.75,delay); num4=rcosine(fd,fs,'fir/normal',1,delay); %分别求四种情况下的升余弦函数的幅度响应 Hwa=abs(fft(num1,1000)); Hwb=abs(fft(num2,1000)); Hwc=abs(fft(num3,1000)); Hwd=abs(fft(num4,1000)); angH1=angle(fft(num1,1000)); angH2=angle(fft(num2,1000)); angH3=angle(fft(num3,1000)); angH4=angle(fft(num4,1000)); t=0:1/fs:1/fs*(length(num1)-1); %分别画出四种情况下的升余弦对应的时域波形 figure(1);

资源截图

代码片段和文件信息


clear all;
close all;
fd=1e3;
fs=fd*10;
delay=5;

                                                 %分别求四种情况下的升余弦函数
 num1=rcosine(fdfs‘fir/normal‘0delay);
 num2=rcosine(fdfs‘fir/normal‘0.5delay);
 num3=rcosine(fdfs‘fir/normal‘0.75delay);
 num4=rcosine(fdfs‘fir/normal‘1delay);
                                                %分别求四种情况下的升余弦函数的幅度响应
    Hwa=abs(fft(num11000));
    Hwb=abs(fft(num21000));
    Hwc=abs(fft(num31000));
    Hwd=abs(fft(num41000));
    angH1=angle(fft(num11000));
    angH2=angle(fft(num21000));
    angH3=angle(fft(num31000));
    angH4=angle(fft(num41000));
    
    
    t=0:1/fs:1/fs*(length(num1)-1);              %分别画出四种情况下的升余弦对应的时域波形
    figure(1); 
    plot(tnum1‘-‘);hold on;text(0.00363-0.21‘\rightarrowα=0‘ ‘FontSize‘11)

    plot(tnum2‘:‘);text(0.0034-0.10‘\rightarrowα=0.5‘ ‘FontSize‘11);hold on;
    plot(tnum3‘-.‘);text(0.00358-0.05‘\rightarrowα=0.75‘ ‘FontSize‘11);hold on;
    plot(tnum4‘--‘);text(0.003520.006‘\rightarrowα=1‘ ‘FontSize‘11);hold on;
    ylabel(‘四种升余弦对应的时域波形‘) ; xlabel(‘时间/s‘) ;title(‘-实线表α=0:点线表α=0.5—.点划线表α=0.75— —虚线表α=1‘);
    grid on;
  
    f=(1:fs/1000:fs)-1;                            %分别画出四种情况下的升余弦对应的幅频响应
    figure(2);
    plot(fHwa‘-‘);text(43610.2‘\rightarrowα=0‘ ‘FontSize‘11);hold on;
    plot(fHwb‘:‘);text(3519.0‘\rightarrowα=0.5‘ ‘FontSize‘11);hold on;
    plot(fHwc‘-.‘);text(3208.4‘\rightarrowα=0.75‘ ‘FontSize‘11);hold on;
    plot(fHwd‘--‘);text(1919.2‘\rightarrowα=1‘ ‘FontSize‘11);hold on ;
    axis([0 1500 0 12]);ylabel(‘四种升余弦对应的幅度谱‘);xlabel(‘频率/Hz‘) ;
title(‘-实线表α=0:点线表α=0.5—.点划线表α=0.75— —虚线表α=1‘);grid on;
figure(3);
subplot(221)
    plot(fangH1);axis([0 1500 0 4]); title(‘α=0‘);ylabel(‘四种升余弦对应的幅度谱‘);xlabel(‘频率/Hz‘) ;grid on;
    subplot(222)
    plot(fangH2);axis([0 1500 0 4]);title(‘α=0.5‘);xlabel(‘频率/Hz‘) ;grid on;
    subplot(223)
    plot(fangH3);axis([0 1500 0 4]);title(‘α=0.75‘);xlabel(‘频率/Hz‘) ;grid on;
    subplot(224)
    plot(fangH4);axis([0 1500 0 4]);title(‘α=1‘);xlabel(‘频率/Hz‘) ;grid on;
    

 
N=2000;                             %数字序列长度
    N_sample=10;                    %每码元抽样次

评论

共有 条评论