LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

noise removal of a sinc

I have a signal (sinc function), in which there is noise (gaussian white noise) added to the system.  My goal is to remove the noise, and recover the original signal as best as possible.  I've tried a series of filters (high, band, low, etc.) and none of them seem to generate an accurate enough signal.  The closest I've gotten to the result that I'm looking for is by using a IIR filter, or a Lowpass filter.  Right now, I'm working on the cubic spline filter, trying to get the balancing input to work, but I'm not having any luck there either.
 
If someone has any ideas that would help a lot.
0 Kudos
Message 1 of 14
(4,396 Views)
Maybe you can just fit your data to a sinc function? What is your LabVIEW version?
0 Kudos
Message 2 of 14
(4,383 Views)
I have LabVIEW 8.0.  Is there something that will allow me too look for a similar pattern?  I am seeing (gaussian peak fit.vi), but is there something else that I should be trying?
0 Kudos
Message 3 of 14
(4,382 Views)
Use the "nonlinear curve fit" and make a model for the sinc function. Search the example finder for "Levenberg-Marquardt" for some demos.
0 Kudos
Message 4 of 14
(4,374 Views)
Still working on the non-linear fitting of a sinc function with added gaussian noise.  I tried to look at some examples for the Levenberg-Marquardt method, but I'm having some trouble understanding the functionality and data flow.  Here is the example I was originally looking at.
 
Next, I started to go a bit simpler, and tried using the CurveFitting.vi while adjusting the properties, just as follows:
 
Non-Linear
  -Independent Variable: X
  -Maximum Interations: 500
  -Non-linear model: sinc(x)/x
 
But for some reason, I'm getting an error that says I need to have NumSamples > 0... which I thought I already declared.  Hopefully this is just a simple problem, and I'm making a stupid mistake.
0 Kudos
Message 5 of 14
(4,344 Views)
I'm replying to my own question, just so other people will have a future reference for a similar problem.
 
Originally, I had some issues using the Curve_Fitting.vi.  The error message I was receiving was (number of samples needs to be > 0).  Even with all the inputs correctly wired, the message was still displaying.  My problem was the curve fitting equation I was using.
 
I used sinc(x) because i wanted to fit the points to a graph in the shape of a sinc.  Apparently you need to specify other parameters, so that there is an initial guess.  By using the following equation: a*sinc(x)+b, I was able to get the vi to function properly.
0 Kudos
Message 6 of 14
(4,330 Views)

Great that it worked out for you. Yes, you definitely need reasonable initial estimates for the fitting parameters. Sinc is a relatively difficult function and you can easily get trapped in local minima (or worse) if the initial estimate is way off.

I case you're coming to NI-Week, stop by at session I87 and we'll chat a bit. 😄

http://www.ni.com/niweek/

 

0 Kudos
Message 7 of 14
(4,325 Views)

Yeah, unfortunately I don't think I'll be able to make it down to Austin for the conference.

 

But more importantly, I don’t think I completely solved my curve fitting problem.  The curve fitting vi that I am using isn’t generating the output that I was expecting.  My goal is to simply add noise to a signal, then reconstruct the signal finding the best fit line/curve, which best represents the original signal.  Here is where I currently stand:

 

The frequency of the new graph is too high.  A sinc function is produced, but it doesn’t share the same form as the original signal. 

 

I've tried other options, such as the Levenberg-Marquardt method, but this is proving to be a bit difficult to understand.  I will attach the curve_fitting.vi and the Levenberg-Marquardt example that I was looking at.  I think the LM vi is very close to what I need, but I’m having trouble integrating my own numbers into the program, to generate the results that I need.  If anyone has any advice with the curve fitting, or any information that might 'dumb-down' some of the sub vi's in the Levenberg-Marquardt program model, it would help me out.

Download All
0 Kudos
Message 8 of 14
(4,315 Views)
I think you need to watch out for inconsistent units for x! (Are you in radians or degrees, for example?)
 
For simplicty, I added another paramter:
 
a*sinc(c*x) + b
 
Now I get a pretty good fit, even from pretty bad starting values !
 

Message Edited by altenbach on 07-25-2006 03:51 PM

0 Kudos
Message 9 of 14
(4,311 Views)

OK, The previous was the quick "1 minute answer". After some more investiagtions, here is a better answer: 😄

The sinc pattern generator is defined as sinc(x)=sin(pi*x)/(pi*x). Check the online help! If the x is "calibrated" your formula reduces to Asinc(x)+B (your original formula), which is linear in both parameters. Thus you can easily use the "general least squares linear" model with sinc(x) and 1 as the components! 🙂

To test:

  1. WIre "1/pi" diagram constant to the "delta T" input of sinc pattern or calculate the correct x array and feed it to the "locations" input.
  2. Use "general least squares linear" as in the figure below. This is preferred and now you don't even need initial guesses.
  3. Voila!

You just need to  scale your x correctly!

Message Edited by altenbach on 07-25-2006 05:26 PM

Message 10 of 14
(4,304 Views)