MATLAB信号减采样

MATLAB信号减采样在不影响计算结果精度的前提下,为了降低计算成本,通常对信号进行减采样。减采样之后的样本仍需满足大于奈奎斯特频率,以避免产生混叠。为了避免发生混叠,通常应在减采样前施加一个抗混叠低通滤波器。https://cnx.org/contents/p8E-T146@5/Decimation-and-Do

大家好,欢迎来到IT知识分享网。

在不影响计算结果精度的前提下,为了降低计算成本,通常对信号进行减采样。

减采样之后的样本仍需满足大于奈奎斯特频率,以避免产生混叠。

为了避免发生混叠,通常应在减采样前施加一个抗混叠低通滤波器。

https://cnx.org/contents/p8E-T146@5/Decimation-and-Downsampling

Decimation

MATLAB信号减采样

 

 MATLAB信号减采样

 

 比如一个128Hz的信号,想减采样至32Hz,系数M=4。我们可以先对原始信号进行抗混叠低通滤波,2M=8,截止频率为128/8 = 16Hz。然后进行downsample。减采样之后的样本仍满足大于奈奎斯特频率,避免产生混叠。

 

decimate

减采样之前,为了防止产生混叠对输入进行低通滤波(By default, decimate uses a lowpass Chebyshev Type I IIR filter of order 8.)

y = decimate(x,r)

减采样系数为r,length(y) = ceil(length(x)/r)

y = decimate(x,r,n)

 uses a Chebyshev filter of order n. Orders above 13 are not recommended because of numerical instability.

指定滤波器阶次,由于数值不稳定,一般阶次不超过13。

y = decimate(x,r,’fir’)

 uses an FIR filter designed using the window method with a Hamming window. The filter has order 30.

使用基于窗方法设计的FIR滤波器,默认阶次为30。

y = decimate(x,r,n,’fir’)

使用基于窗方法设计的FIR滤波器,并指定滤波器阶次。

 

For better results when r is greater than 13, divide r into smaller factors and call decimate several times.

为了获得更好的结果,当r大于13时,将r分成较小的因子,并多次抽取。

r = 13;
n = 16:365;
lx = length(n);
x = sin(2*pi*n/153) + cos(2*pi*n/127);

plot(0:lx-1,x,'o')
hold on
y = decimate(x,r,82,'fir');
stem(0:r:lx-1,y,'ro','filled','markersize',4)

legend('Original','Decimated','Location','south')
xlabel('Sample number')
ylabel('Signal')

MATLAB信号减采样

 

 downsample

y = downsample(x,n)

decreases the sampling rate of x by keeping every nth sample starting with the first sample. x can be a vector or a matrix. If x is a matrix, each column is considered a separate sequence.

对x减采样,从第一个样本开始,每n个样本取一个。如果x是矩阵,每一列被看做是一个独立序列。

y = downsample(x,n,phase)

指定相位偏移

x = [1 2 3 4 5 6 7 8 9 10];
y = downsample(x,3)

y = 

     1     4     7    10

y = downsample(x,3,2)

y = 

     3     6     9

resample

Resample uniform or nonuniform data to new fixed rate

将均匀或非均匀数据重新采样为新的固定采样频率

y = resample(x,p,q)

resamples the input sequence, x, at p/q times the original sample rate. If x is a matrix, then resample treats each column of x as an independent channel. resample applies an antialiasing FIR lowpass filter to x and compensates for the delay introduced by the filter.

对x重采样,采样频率是原始采样频率的p/q 倍。如果x是矩阵,每一列被看做是一个独立序列。重采样将抗混叠FIR低通滤波器应用于x并补偿滤波器引入的延迟。

 y = resample(x,p,q,n)

uses an antialiasing filter of order 2 × n × max(p,q).

y = resample(x,p,q,n,beta)

specifies the shape parameter of the Kaiser window used to design the lowpass filter.

y = resample(x,p,q,b)

filters x using the filter coefficients specified in b. b为滤波器系数向量。

 

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/31901.html

(0)

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信