频域和空域中的汉明滤波器 [英] Hamming Filter in Frequency and Spatial Domain

查看:269
本文介绍了频域和空域中的汉明滤波器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过在MATLAB中对其应用Hamming滤波器来消除一维信号中的Gibbs伪像.

I want to remove the Gibbs artifact in a 1D signal by applying the Hamming filter on that in MATLAB.

我所拥有的是k1,它是频域中的信号.我可以通过在k1上应用DFT来获取时域中的信号:

What I have is the k1 which is the signal in frequency domain. I can get the signal in time domain by applying DFT on k1:

s1 = ifft(ifftshift(k1));

此信号具有Gibbs伪像.现在,我想通过(A)在频域中将汉明滤波器乘以k1并将(B)在空间域中将汉明滤波器的IFFT与s1卷积来将其删除.我期望这两者的输出相同:

This signal has Gibbs artifact. Now, I want to remove it by (A) multiplying Hamming filter to k1 in teh frequency domain and (B) convolving IFFT of Hamming filter with s1 in the spatial domain. I am expecting same output from both of these:

% (A) Multiplying Hamming filter to `k1`
n = size(k1,2);
wk = hamming(n,'symmetric')'; 
k2 = wk.*k1;
s2 = ifft(ifftshift(k2));

% (B) Convolving IFFT of Hamming filter with `s1`
wx = ifft(ifftshift(wk));
s3 = conv(s1,wx,'same');

(A)的结果s2似乎是正确的,因为信号看起来模糊并且Gibbs伪影消失了.但是,(B)的结果s3完全不同且不正确. (B)中缺少什么? (如果需要,请从此链接下载k1.mat.)

The result of (A), s2, seems to be correct since the signal looks blurred and the Gibbs artifact is gone. However, the result of (B), s3, is completely different and incorrect. What is missing in (B)? (Please download k1.mat from this link if you need it.)

推荐答案

在您发布的数据中,您在space上称为"Gibbs"的是频率上的高频分量.实际上,当您将汉明窗口乘以频率时,实际上是在平滑那些较高的频率.它们位于复数数组k1的边界(负数和正数)中.

From the data you posted what you call "Gibbs" on space are high frequency components on frequency. When you multiply your hamming window in frequency in fact you are smoothing those higher frequencies. They are in the borders (negative and positive) of your complex array k1.

当您制作k2 = wk.*k1时,会发生以下情况;

Bellow is what happens when you make k2 = wk.*k1;

这就是为什么您所谓的"Gibbs"空间消失了的原因.

That's why your so called space "Gibbs" is gone.

这不是通常在time|space上使用的汉明(Hamming)窗口的标准用法,当在time|space上对信号,函数或滤波器内核进行裁剪和采样时,可以降低吉布的出现频率.

This is not a stander use of a Hamming window that is commonly applied on time|space to reduce Gibb's on frequency when clipping and sampling a signal, function or filter kernel on time|space.

要在space中重现它,您必须设计一个非常平滑的低通滤波器,该滤波器在频率上给汉明窗响应以进行卷积.我不记得汉明窗的逆变换,但可以使用高斯滤波器.

To reproduce it in space you would have to design a very smooth low pass filter that gives the hamming window response in frequency to make that convolution. I don't recall the inverse transform of a Hamming Window but you could use a gaussian filter.

Btw wx = ifft(ifftshift(wk));给出一个wx关于其最大值的不对称信息.

Btw wx = ifft(ifftshift(wk)); gives a wx not symmetric with respect to its maximum.

这篇关于频域和空域中的汉明滤波器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆