小岳不熬夜 2022-10-20 22:16 采纳率: 100%
浏览 53
已结题

如何利用海明窗设计N=24(23阶)的FIR线性相位数字微分器(用matlab),并求出h(n)(传递函数),并求出h(n)(传递函数),并画出幅频特性和相频特性

这个FIR线性相位数字微分器怎么用matlab设计?

如何利用海明窗设计N=24(23阶)的FIR线性相位数字微分器(用matlab实现),并求出h(n)(传递函数),并画出幅频特性和相频特性。

好难啊,怎么做教一下,请给出matlab代码和图,谢谢啦

  • 写回答

1条回答 默认 最新

  • 鹅毛在路上了 Matlab领域优质创作者 2022-10-21 00:01
    关注
    clc,clear,close all;
    %hamming窗
    M=23;alpha=(M-1)/2;n=0:M-1;
    hd=(cos(pi*(n-alpha)))./(n-alpha);hd(alpha+1)=0;
    w_ham=(hamming(M))'; h=hd.*w_ham; [Hr,w,P,L]=Hr_Type3(h);
    %plots
    subplot(221);stem(n,hd);
    title('Ideal Impulse Response') 
    axis([-1 M -1.2 1.2]);
    xlabel('n');ylabel('hd(n)') 
    subplot(222);stem(n,w_ham);
    title('Hamming Window') 
    axis([-1 M 0 1.2]);xlabel('n');ylabel('w(n)') 
    subplot(223);stem(n,h);
    title('Actual Impulse Response') 
    axis([-1 M -1.2 1.2]);xlabel('n');ylabel('h(n)')
    subplot(224);plot(w/pi,Hr/pi);
    title('Amplitude Response');grid;
    axis([0 1 0 1]);xlabel('frenquency in pi units');ylabel('slope in pi units');
    
    
    %子函数:
    function [Hr,w,c,L] = Hr_Type3(h);
    % Computes Amplitude response of Type-3 LP FIR filter
    % -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  ---
    % [Hr,w,c,L] = Hr_Type3(h)
    
    % Hr = Amplitude Response
    %  w = frequencies between [0 pi] over which Hr is computed
    %  c = Type-3 LP filter coefficients
    %  L = Order of Hr
    %  h = Type-3 LP impulse response
    %
    M = length(h);
    L = (M-1)/2;
    c = [2*h(L+1:-1:1)];
    n=[0:1:L];
    w = [0:1:500]'*pi/500;
    Hr = sin(w*n)*c';
    end
    

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 10月21日
  • 已采纳回答 10月21日
  • 创建了问题 10月20日

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看