06-07-2013 05:21 PM
Hello,
Attached is my program, which takes in two input signals, first is "In Phase" or "Corrupted" signal -C-, and second is "Out of Phase" or "Noise" signal -N-.
First, since the In Phase signal contains a DC component, I extract it.
Now I want to implement Wiener Filetr, which has the following simple Transfer Function:
TF = ( |C(f)|^2 + |N(f)|^2 ) / |C(f)|^2.
Problem is that it takes too long to run, and even worse it does not work.
Any ideas?
I couldn't attach the two .csv files so I uploaded them on my 4shared account:
06-08-2013 06:56 AM
I hope the idea is clear, sorry I am not a native speaker.
06-09-2013 04:46 PM
Hello again,
could the problem be possible related to using the express Vi curve fitting?
06-09-2013 05:32 PM - edited 06-09-2013 05:34 PM
1. You can change the file extension to .txt and attach them, or combine the files in a zip archive and attach that.
2. The files appear to have only one non-zero value each, row 3768, column 0. Values 54 and 51. Filtering or curve fitting on such data does not seem to make much sense. In the image below the top graph is the input to the curve fitting and the bottom graph has the output. Other than the peaks being close the the same x-axis values, the two curves do not resemble each other very well.
Subtracting that does not remove the DC component. Using the Mean.vi is the typical way of removing a DC component. Either way the spectrum seems to have very little of interest. Its variations are a few parts in 10^15. That is almost certainly numeric round off in the calculations rather than anything meaningful in the data.
I do not have the Filter Design toolkit so I cannot comment on the filter.
If speed is an issue, do not use the Express VI for curve fitting. Express VIs tend to have a lot of overhead which makes them slower. I have not checked this one against the conventional curve fitting VIs. Also converting to waveforms before wiring to the FFT is wasted because the FFT converts back to array. Just use the array directly or use one of the waveform spectral VIs.
Lynn
06-09-2013 05:51 PM
Hi,
The data are OK, I am attaching the two files as .txt here:
06-10-2013 08:56 AM
BTW, your suggestion about using MEan.vi did not work. Because the drifting is changing in time.
06-11-2013 06:43 PM
Hi Ali8,
Could you explain further what you mean when you say it doesn't work? What are you expecting to see in your results?
Have you been able to identify a place in the code where the result is not what you'd expect? I'd recommend tracing it through to see where the value deviates from what it should be.
06-11-2013 07:59 PM - edited 06-11-2013 08:11 PM
One of your problems seems to be calculations resulting in NAN (see attached photo)...
However, there is something else that is quite strange and I'm not sure if it is related to the above problem: I probed your data and I just can't tell why there is such a huge lag between probe# 32 and 33 - there is nothing between them!! This seems a bit tricky, unless if someone else knows what would cause that!?
(your input data look fine, but it seems like your implemented math has issues - data in probe 33 do not look right.)
-DP
06-11-2013 09:41 PM - edited 06-11-2013 09:41 PM
@Dave.C:
Here since I provided only a sample of the data, it may not show clearly, but look at the following snapshot taken with the full data used:
As you can see, the data has an almost linear DC bias, using mean.vi I wasn't able to get rid of it. My implementation is fine as it get rid of the bias, as shown above.
Anyway this is not the issue here. Our problem is with the TF implementation.
@BTC_admin: I have no idea why, but I am looking at it.