《DSP using MATLAB》Problem 8.12

代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.12 \n\n'); banner();
%% ------------------------------------------------------------------------ Wp = 500; Ws = 2000; Rp = 0.25; As = 50;
Fp = Wp/(2*pi);
Fs = Ws/(2*pi); Ripple = 10 ^ (-Rp/20)
Attn = 10 ^ (-As/20) % Analog filter design:
[b, a] = afd('butter', Fp, Fs, Rp, As);
%[b, a] = afd_butt(Wp, Ws, Rp, As); % Calculation of second-order sections:
[C, B, A] = sdir2cas(b, a); % Calculation of Frequency Response:
[db, mag, pha, ww] = freqs_m(b, a, 2500); % Calculation of Impulse Response:
[ha, x, t] = impulse(b, a); %% -------------------------------------------------
%% Plot
%% ------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.12 Analog Butterworth lowpass')
set(gcf,'Color','white');
M = 1.0; % Omega max subplot(2,2,1); plot(ww, mag); grid on; axis([-2100, 2100, 0, 1.2]);
xlabel(' Analog frequency in rad/sec units'); ylabel('|H|'); title('Magnitude in Absolute');
set(gca, 'XTickMode', 'manual', 'XTick', [-500, 0, 500, 2000]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.003, 0.97, 1]); subplot(2,2,2); plot(ww, db); grid on; %axis([0, M, -50, 10]);
xlabel('Analog frequency in rad/sec units'); ylabel('Decibels'); title('Magnitude in dB ');
set(gca, 'XTickMode', 'manual', 'XTick', [-500, 0, 500, 2000]);
set(gca, 'YTickMode', 'manual', 'YTick', [-50, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['50';' 1';' 0']); subplot(2,2,3); plot(ww, pha/pi); grid on; axis([-2100, 2100, -1.2, 1.2]);
xlabel('Analog frequency in rad/sec nuits'); ylabel('radians'); title('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [-500, 0, 500, 2000]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]); subplot(2,2,4); plot(t, ha); grid on; %axis([0, 30, -0.05, 0.25]);
xlabel('time in seconds'); ylabel('ha(t)'); title('Impulse Response');
运行结果:
通带ripple和阻带衰减,将题中的dB单位转换为以绝对值为单位。

非归一化模拟Butterworth低通滤波器,直接形式(有理函数)的系数,

将H(s)转换成串联形式,即一系列二阶子滤波器的乘积形式

模拟滤波器的幅度谱、相位谱和脉冲响应序列。

《DSP using MATLAB》Problem 8.12的更多相关文章
- 《DSP using MATLAB》Problem 7.12
阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 6.12
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.12
1.从别的地方找的证明过程: 2.代码 function x2 = circfold(x1, N) %% Circular folding using DFT %% ----------------- ...
- 《DSP using MATLAB》Problem 4.12
代码: function [As, Ac, r, v0] = invCCPP(b0, b1, a1, a2) % Determine the signal parameters Ac, As, r, ...
- 《DSP using MATLAB》Problem 3.12
- 《DSP using MATLAB》Problem 7.6
代码: 子函数ampl_res function [Hr,w,P,L] = ampl_res(h); % % function [Hr,w,P,L] = Ampl_res(h) % Computes ...
- 《DSP using MATLAB》Problem 6.22
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 6.8
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.21
证明: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- drools决策表的使用
决策表我们在drools规则引擎初探里做了简单介绍,这里主要是介绍如何通过java代码来把这个excel文件和drools关联起来,如何使其达到我们想要的效果. 这里假设我们在resources目录下 ...
- Altera设置Virtual Pin
1,GUI方式 大家都知道的,assignment editor –> category –> logic options –> to –> virtual pin –> ...
- Jupyter notebook文件默认存储路径以及更改方法
1.文件默认存储路径怎么查? 安装Anaconda后,新建文件的默认存储路径一般在C系统盘,那么路径是什么呢? 首先,新建一个.ipynb文件, 输入以下脚本,运行出的结果即是当前jupyter文件 ...
- C/C++ ShowWindow()
{ ShowWindow(HWND,0);//不显示窗口 }
- 解决k8s gcr.io被墙下载不了镜像的问题
gcr.io镜像 根据开源项目: https://github.com/anjia0532/gcr.io_mirror 作者将gcr.io相关镜像pull下来,然后push到docker官方仓库htt ...
- java——万年历
package oop; import java.util.Scanner; public class 万年历 { public static void main(String[] args) { / ...
- Delphi利用Windows GDI实现文字倾斜
Delphi利用Windows GDI实现文字倾斜 摘要 Delphi利用Windows GDI实现文字倾斜 procedure TForm1.FormPaint(Sender: TObject);v ...
- BZOJ 1911 (APIO 2010) 特别行动队
题目描述 你有一支由n名预备役士兵组成的部队,士兵从1到n编号,要将他们拆分成若干特别行动队调入战场.出于默契考虑,同一支特别行动队中队员的编号应该连续,即为形如(i,i+1,-,i+k)的序列. 编 ...
- [kuangbin带你飞]专题一 简单搜索 - E - Find The Multiple
//Memory Time //2236K 32MS #include<iostream> using namespace std; ]; //保存每次mod n的余数 //由于198的余 ...
- Linux操作系统系列-Linux基础
概述 先了解下unix,unix是一个多任务.多用户的操作系统,并且是收费的操作系统. 1991年的10月5日,林纳斯·托瓦兹在comp.os.minix新闻组上发布消息,正式向外宣布Linux内核的 ...