How can I approximate a certain section of a vector to remove noise?
이전 댓글 표시
I have some plots of S-parameters from a network analyzer, and they have a large amount of noise around 2.4 GHz. I am relatively certain that this noise is due to the Wi-Fi signal in the lab where I am working, so I would like to remove this section of the vector entirely and replace it with an approximation of what the line should look like. These vectors are complex, which complicates the issue because if I use local linear approximation, the real and imaginary components turn out alright, but the magnitude still looks pretty bad. I've tried using some sort of interpolation function (like spline or pchip) but I can't seem to get it to do what I want, which is to entirely remove one section of the vector and replace it with values that fit with the curve before and after. I've attached a few plots to show the issue. The [Raw] plots are straight from the network analyzer, and the [Corrected] plots have simply been "fixed" with local linear approximation on both the real and imaginary components. Thanks!
채택된 답변
추가 답변 (1개)
Andrew Reibold
2014년 7월 29일
편집: Andrew Reibold
2014년 7월 29일
A easy solution is to either use polyfit or take a moving line average of your data, but you lose some resolution.
Try
data = smooth(yourdata)
Smoothing twice dramatically reduces noise:
data = smooth(smooth(yourdata))
By default, its is a 5 point moving line average.
I wouldn't recommend doing it too many times, especially if you have very few data points. Once or twice should be fine in most situations.
(Taking the moving line average 100 times would results in a flat line)
카테고리
도움말 센터 및 File Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
