Hann Window Smoothing Help

2 次查看(过去 30 天)
Kayleigh
Kayleigh 2013-11-20
评论: Wayne King 2013-11-20
Hi,
I'm attempting to smooth a set of values in an attempt to remove problems visualising the data which is skewed toward single points with high values amongst regions of low values - such as the one highlighted below. The first column below is essentially the X-axis value and the second column are the Y-axis values i'm trying to smooth.
87 1
109 1
298 1
396 1
400 1
412 455
414 1
415 1
417 2
Within MatLab i've carried out smoothing by using a Hann window, creating it with:
hann15=hanning(15);
and smoothing the signal with:
smooth15=conv(signal,hann15,'same');
However i've noticed that if I manually alter the Y values to include an aberrantly strong peak of the kind we are trying to reduce the prevalence of - this smoothing method includes the new value and constructs a smoothed peak bias toward this one outlier, increasing the flanking values.
Is there a way to get around this? Perhaps I need a new smoothing window shape?
Thanks for any help! I should add that i've never used MATLAB before today so i'm a total novice.
- Kayleigh

回答(1 个)

Wayne King
Wayne King 2013-11-20
Hi Kayleigh, Welcome to MATLAB. If your signal truly consists of values like
1 2 1 455 1 2
Then I think there are better ways to handle this:
1.) You can simply identify those values in your waveform, remove them, and then interpolate the missing value with the surrounding signal values.
2.) If you have the Wavelet Toolbox, there is an easy way to do this with wavelets. You can take the wavelet transform of the signal, those large values will be localized to the fine-scale coefficients, so you can remove those and reconstruct your signal without the large values.
It would help if you could attach a representative data file and if you can say whether you have the Wavelet Toolbox installed.
>>ver
will list which toolboxes you have.
  2 个评论
Kayleigh
Kayleigh 2013-11-20
I’ve attached my actual data as a .txt file which I import from. I currently have the Wavelet Toolbox (v4.11) installed. The original reason for smoothing the data was to improve it’s visualisation - often some regions of Y-values can appear much larger than they perhaps are due to a single point with a high value while the surrounding values are very low.
Hope i’m making sense and thanks for the welcome!
Wayne King
Wayne King 2013-11-20
Thank you for the data, you have a large number of these peaks in your data, so I don't think the interpolation method will work.
The question is what size peaks do you want to maintain. You have many large values but also "intermediate" values as well.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by