大毕设-MATLAB-常用知识回顾
要用到FIR滤波器和抽样器下面研究这两个的Matlab实现:
Fir滤波器:
matlab上fir滤波器的关键字是fir1
在command窗口输入help fir1出现帮助文档:
>> help fir1
fir1 FIR filter design using the window method. fir滤波器使用窗函数法设计
B = fir1(N,Wn) designs an N'th order lowpass FIR digital filter B = fir1(N,Wn)这样是设计一个N阶低通滤波器
and returns the filter coefficients in length N+1 vector B. 以一个N+1阶向量的形式返回滤波器系数
The cut-off frequency Wn must be between 0 < Wn < 1.0, with 1.0 截止频率Wn在0~1之间
corresponding to half the sample rate. The filter B is real and 1.0表示截止频率为半 采样率
has linear phase. The normalized gain of the filter at Wn is 这样得到的滤波器B是实且线性相位
-6 dB. 截止频率处的增益Wn是-6dB
B = fir1(N,Wn,'high') designs an N'th order highpass filter. B = fir1(N,Wn,'high') 产生一个N阶高通滤波器
You can also use B = fir1(N,Wn,'low') to design a lowpass filter. B = fir1(N,Wn,'low') 可以产生N阶低通滤波器
If Wn is a two-element vector, Wn = [W1 W2], fir1 returns an 如果Wn(Wn = [W1 W2])是二元向量,fir1函数返回一个N阶带通滤波器
order N bandpass filter with passband W1 < W < W2. You can 通带是W1到W2, B = fir1(N,Wn,'bandpass')用来产生带通滤波器
also specify B = fir1(N,Wn,'bandpass'). If Wn = [W1 W2], B = fir1(N,Wn,'stop')产生带阻
B = fir1(N,Wn,'stop') will design a bandstop filter.
If Wn is a multi-element vector, 如果Wn是一个多元向量
Wn = [W1 W2 W3 W4 W5 ... WN], 例如Wn = [W1 W2 W3 W4 W5 ... WN],
fir1 returns an order N multiband filter with bands fir1函数产生一个多频带?滤波器
0 < W < W1, W1 < W < W2, ..., WN < W < 1. 0 < W < W1, W1 < W < W2, ..., WN < W < 1.
B = fir1(N,Wn,'DC-1') makes the first band a passband. B = fir1(N,Wn,'DC-1')表示第一个频带是通带
B = fir1(N,Wn,'DC-0') makes the first band a stopband. B = fir1(N,Wn,'DC-1')表示第一个频带是阻带
B = fir1(N,Wn,WIN) designs an N-th order FIR filter using B = fir1(N,Wn,WIN) ,WIN是长度为N+1的窗的向量,会产生一个N阶脉冲响应
the N+1 length vector WIN to window the impulse response.
If empty or omitted, fir1 uses a Hamming window of length N+1. 如果没有参数WIN,fir1函数会默认使用长度为N+1的汉明窗
For a complete list of available windows, see the help for the 查看窗函数了解更多WIN的知识
WINDOW function. KAISER and CHEBWIN can be specified with an 可以这样添加窗函数
optional trailing argument. For example, B = fir1(N,Wn,kaiser(N+1,4))
uses a Kaiser window with beta=4. B = fir1(N,Wn,'high',chebwin(N+1,R))
uses a Chebyshev window with R decibels of relative sidelobe
attenuation.
For filters with a gain other than zero at Fs/2, e.g., highpass
and bandstop filters, N must be even. Otherwise, N will be
incremented by one. In this case the window length should be
specified as N+2.
By default, the filter is scaled so the center of the first pass band
has magnitude exactly one after windowing. Use a trailing 'noscale'
argument to prevent this scaling, e.g. B = fir1(N,Wn,'noscale'),
B = fir1(N,Wn,'high','noscale'), B = fir1(N,Wn,wind,'noscale'). You
can also specify the scaling explicitly, e.g. fir1(N,Wn,'scale'), etc.
% Example 1:
% Design a 48th-order FIR bandpass filter with passband
% 0.35 <= w <= 0.65.
b = fir1(48,[0.35 0.65]); % Window-based FIR filter design
freqz(b,1,512) % Frequency response of filter
% Example 2:
% The chirp.mat file contains a signal, y, that has most of its power
% above fs/4, or half the Nyquist frequency. Design a 34th-order FIR
% highpass filter to attenuate the components of the signal below
% fs/4. Use a cutoff frequency of 0.48 and a Chebyshev window with
% 30 dB of ripple.
load chirp; % Load data (y and Fs) into workspace
y = y + 0.5*rand(size(y)); % Adding noise
b = fir1(34,0.48,'high',chebwin(35,30)); % FIR filter design
freqz(b,1,512); % Frequency response of filter
output = filtfilt(b,1,y); % Zero-phase digital filtering
figure;
subplot(211); plot(y,'b'); title('Original Signal')
subplot(212); plot(output,'g'); title('Filtered Signal')
See also kaiserord, fircls1, fir2, firls, fircls, cfirpm,
firpm, freqz, filter, window, designfilt.
help fft fft函数
fft Discrete Fourier transform. fft离散傅里叶变换
fft(X) is the discrete Fourier transform (DFT) of vector X. For fft(X)表示对向量X做离散傅里叶变换
matrices, the fft operation is applied to each column. For N-D
arrays, the fft operation operates on the first non-singleton
dimension.
fft(X,N) is the N-point fft, padded with zeros if X has less fft(X,N) 对X做N点傅里叶变换,X点数不够补0有多截断
than N points and truncated if it has more.
fft(X,[],DIM) or fft(X,N,DIM) applies the fft operation across the
dimension DIM.
For length N input vector x, the DFT is a length N vector X,
with elements
N
X(k) = sum x(n)*exp(-j*2*pi*(k-1)*(n-1)/N), 1 <= k <= N.
n=1
The inverse DFT (computed by IFFT) is given by
N
x(n) = (1/N) sum X(k)*exp( j*2*pi*(k-1)*(n-1)/N), 1 <= n <= N.
k=1
See also fft2, fftn, fftshift, fftw, ifft, ifft2, ifftn.
fft 的参考页
名为 fft 的其他函数
大毕设-MATLAB-常用知识回顾的更多相关文章
- javascript常用知识汇总
javascript这个语言庞大而复杂,我用了三年多了,还是皮毛都不会.从刚开始的jquery,到后来的es6,每天都在学习,每天都在忘记. 1.禁止手机虚拟键盘弹出 在开发适配手机的页面时,出现了这 ...
- [C#] C# 知识回顾 - 你真的懂异常(Exception)吗?
你真的懂异常(Exception)吗? 目录 异常介绍 异常的特点 怎样使用异常 处理异常的 try-catch-finally 捕获异常的 Catch 块 释放资源的 Finally 块 一.异常介 ...
- [C#] C# 知识回顾 - 学会处理异常
学会处理异常 你可以使用 try 块来对你觉得可能会出现异常的代码进行分区. 其中,与之关联的 catch 块可用于处理任何异常情况. 一个包含代码的 finally 块,无论 try 块中是否在运行 ...
- [C#] C# 知识回顾 - 学会使用异常
学会使用异常 在 C# 中,程序中在运行时出现的错误,会不断在程序中进行传播,这种机制称为“异常”. 异常通常由错误的代码引发,并由能够更正错误的代码进行 catch. 异常可由 .NET 的 CLR ...
- [C#] C# 知识回顾 - 异常介绍
异常介绍 我们平时在写程序时,无意中(或技术不够),而导致程序运行时出现意外(或异常),对于这个问题, C# 有专门的异常处理程序. 异常处理所涉及到的关键字有 try.catch 和 finally ...
- C# 知识回顾 - 装箱与拆箱
装箱与拆箱 目录 生活中的装箱与拆箱 C# 的装箱与拆箱 值类型和引用类型 装箱 拆箱 生活中的装箱与拆箱 我们习惯了在网上购物,这次你想买本编程书 -- <C 语言从入门到放弃> ...
- [C#] C# 知识回顾 - 装箱与拆箱
装箱与拆箱 目录 生活中的装箱与拆箱 C# 的装箱与拆箱 值类型和引用类型 装箱 拆箱 读者见解 生活中的装箱与拆箱 我们习惯了在网上购物,这次你想买本编程书 -- <C 语言从入门到放弃 ...
- C++ 基础知识回顾总结
一.前言 为啥要写这篇博客?答:之前学习的C和C++相关的知识,早就被自己忘到一边去了.但是,随着音视频的学习的不断深入,和C/C++打交道的次数越来越多,看代码是没问题的,但是真到自己操刀去写一些代 ...
- [C#] C# 知识回顾 - Lambda
C# 知识回顾 - Lambda 序 它是第十一个希腊字母,一个拥有失意.无奈.孤独.低调等含义的流行符号,也指示一款称为“半条命”的游戏. 不过,这次我所讲的是 C# 中的 Lambda. 目录 L ...
随机推荐
- 设置树莓派3 B+的静态IP
修改/etc/dhcpcd.conf 文件 sudo vim /etc/dhcpcd.conf interface eth0 static ip_address= static routers=192 ...
- Python基础(二)之集合
集合以{}形式表现,一个集合中的元素各不相同,即集合体现为去重的特性.主要用于关系测试,常见的集合操作:交集.并集.插件.子集.父集.对称差集等. 设置集合: list_1 = [1,3,4,5,7, ...
- Python基础(二)之list
列表:用[]表示 常用方法: list.append,list.insert,list.remove,list.pop,list.count,list.sort,list.reverse,list.i ...
- Bugtags 创业一年总结
出发 在经历过了多轮的 APP 开发/测试/上线/运营周期之后,我们觉得 APP Bug 反馈环节始终十分低效,我们要来改变一下这个状态.于是有了 bugtags.com. 一年 从去年六月正式立项, ...
- SQL加权限
grant view definition on 存储过程名字 to 用户名
- 浏览器缓存相关的Http头介绍:Expires,Cache-Control,Last-Modified,ETag
转自:http://www.path8.net/tn/archives/2745 缓存对于web开发有重要作用,尤其是大负荷web系统开发中. 缓存分很多种:服务器缓存,第三方缓存,浏览器缓存等.其中 ...
- Python基础篇【第7篇】: 面向对象(2)
上一篇<初识面向对象>文章介绍了面向对象基本知识: 面向对象是一种编程方式,此编程方式的实现是基于对 类 和 对象 的使用 类 是一个模板,模板中包装了多个“函数”供使用(可以讲多函数中公 ...
- iOS开发之CocoaPods的使用
你开发iOS的方式还是石器时代吗?在这个世界上并不是所有的软件开发人员都是码农.在这个世界上有很多的geek存在他们为这个语言的发展做出了很大的贡献.现在随着iOS开发者的曾多也就出现了iOS程序猿提 ...
- R&S学习笔记(三)
1.GRE OVER IPv4 GRE协议栈:IPSEC只支持TCP/IP协议的网络,GRE则支持多协议,不同的网络类型.(如IPX,APPLETALK):通常IPSEC over gre结合使用, ...
- MyEclipse10建立Maven Webapp项目并通过git传到GitHub
先创建Maven Webapp项目 图文详解MyEclipse中新建Maven webapp项目的步骤(很详细) 在web项目的路径中右键(前提是你机器已经装了git)“Git Init Here”, ...