zoukankan      html  css  js  c++  java
  • 《DSP using MATLAB》示例Example 10.4

    代码:

    %% ------------------------------------------------------------------------
    %%            Output Info about this m-file
    fprintf('
    ***********************************************************
    ');
    fprintf('        <DSP using MATLAB> Exameple 10.4 
    
    ');
    
    [v, d] = version;
    fprintf('    MATLAB Version: %20s
    
    ', v);
    fprintf('     Released Date: %17s
    
    ', d);
    
    time_stamp = datestr(now, 31);
    [wkd1, wkd2] = weekday(today, 'long');
    fprintf('      Now is %20s, and it is %7s  
    
    ', time_stamp, wkd2);
    %% ------------------------------------------------------------------------
    
    clear; close all;
    % Filter parameters
    format long;
    N = 8; r = 0.9; b = 1; pl  = r*exp(j*2*pi*[0:N-1]/N); a = real(poly(pl));
    
    % Variance-gain (exact)
    Vg = VarGain(b, a)
    
    % Variance-gain (approximate)
    x = [1, zeros(1, 10000)];             % Unit sample sequence
    h = filter(b, a, x);                  % Impulse response
    VgCheck = sum(h.*h)
    
    
    % Filter parameters
    N = 8; r = 0.99; b = 1; pl  = r*exp(j*2*pi*[0:N-1]/N); a = real(poly(pl));
    
    % Variance-gain (exact)
    Vg = VarGain(b, a)
    

      运算结果:

        当N=8,r=0.9时,得到的结果是1.227448727234628(和书上的结果不一致,书中为1.02896272593178,到现在还没找到

    原因),方差增益比1增加了约22%。而当r=0.99时,方差增益超过了673%,意味着当极点靠近单位圆时,滤波器的输出变得非常有噪声。

    牢记: 1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。
  • 相关阅读:
    Cocos2d-x 使用物理引擎进行碰撞检测
    Cocos2d粒子系统二
    cocos2d(粒子效果编辑器)
    关于Cococs中的CCActionEase(下)
    关于Cococs中的CCActionEase(中)
    关于Cococs中的CCActionEase
    call()和apply() 的区别
    WebStorm 使用快捷键大全
    WebStorm 的使用(一)
    导入xlsx,文件到sqlite3数据库
  • 原文地址:https://www.cnblogs.com/ky027wh-sx/p/7955226.html
Copyright © 2011-2022 走看看