From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filter behaviour and improving its working

Solved!
Go to solution
Gabe,

In addition to the excellent points Lynn made, there is one more thing about out-of-band noise to consider. Even if you can over sample by a factor of 1000 -- even if it does "work" -- this over sampling also increases the size of the data you are processing by 1000. You could be left needing to get a faster computer, more memory, or a bigger hard drive because you didn't want to buy a couple parts that together would cost about a quarter.

In terms of power line noise, that is another issue. Because it can be right in the middle of the frequency band you are interested in, you can't filter it at all. Even if you could filter out just exactly 50 or 60 Hz (which you can't, but let's say you could) it wouldn't help because how would your filter distinguish between a power line signal and a pulse at the exact same frequency?

Your only hope is to keep it from getting into the system in the first place through proper sensor selection, shielding, grounding, etc.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 11 of 20
(902 Views)

Gabe,

 

I do not have any specific recommendations on filters for your situation, although I think I have seen such things advertised. You may not find them at the large distributors like Digi-Key or Mouser because they tend to be specialty items. The other issue is that there is not a "one size fits all" solution. As Mike pointed out the power line frequency interference may be in the middle of the desired signal bandwidth. The "damage" to the desired signal due to the power line interference filter needs to be evaluated for each case.

 

Some people use phase locked loop techniques to track the actual power line frequency (which varies slightly) in very narrow bandwidth interference rejection systems.

 

You indicate that this is a recurring problem. That suggests to me that you are not using best practices in your measurement systems.  The time and money spent trying to remove that later might be better spent reducing the amount getting in in the first place.

 

Lynn

0 Kudos
Message 12 of 20
(885 Views)

Hi GabeG,

I am using the evaluation version of  analysing the HRV from here http://www.ni.com/example/30832/en/ 

Is there a way to see the block diagram of this HRV analyser VI.

thanks.

0 Kudos
Message 13 of 20
(865 Views)

Hi GoviRe,

    Did you try ctrl-e? That's the shortcut for opening the block diagram. The only other suggestion would be to see if you can get a vi server reference. Then there is a method to get an image of the block diagram programmatically. It might work... https://decibel.ni.com/content/docs/DOC-18392.

 

Good luck!

 

 

0 Kudos
Message 14 of 20
(857 Views)

Because that is the evaluation version of a toolkit NI sells, I doubt that you will be able to see the block diagram.  If you could see it, you could easily duplicate it and not need to buy it.

 

Lynn

0 Kudos
Message 15 of 20
(848 Views)

Hi,

I tried with ctrl+e but I am unable to see the block diagram of HRV Analyzer of biomedical workbench.

 

I have a set of RR intervals procesed in Matlab as attached for which I want to plot the (same as shown in the link) FFT spectrum of RR interval with PSD(s^2/Hz) against frequency(Hz) and want to calculate the variables(PeakFrequency,VLF,LF,HF,LFnorm,LF/HF ratio) as shown in this link  http://www.ni.com/example/30832/en/ .

Can I get some help with these and also I didnt understood "1.Resampling the RR interval signals".

Thanks.

0 Kudos
Message 16 of 20
(837 Views)

"1.Resampling the RR interval signals"

 

Working with HRV can get very confusing. 

 

First consider what an RR interval signal is: It is a list or array of numbers which represent the time between successive R waves. 820 ms, 850 ms, 875 ms, 862 ms, ... I cannot think of any other kind of signal which has that type of data. The ECG signal itself is a series of numbers which represent the voltage generated by the heart at specific times, almost always equally spaced in time. 1.02 mV @ 0 ms, 0.98 mV @ 2 ms, 0.87 mV @ 4 ms, 0.74 mV @ 6 ms, ...

 

Almost all of the signal processing algorithms and VIs, such as filters and FFT, operate on the assumption that the input data is a voltage (or similar signal) measured (sampled) at uniformly spaced times.

 

The RR interval is not the typical signal and it is definitely not uniformly sampled. It is possible to think of the RR interval as the amplitude of the "signal" and to then process its spectrum, but it must be converted to a uniformly sampled signal. Using the values of RR intervals I listed above as an example we get this:

RR = 820 ms @ t = 0.820, RR = 850 ms @ t = 1.670, RR = 875 ms @ t = 2.545, RR = 862 ms @ t = 3.407. Now suppose we "resample" at the rate of 2 Hz. We would then get:

 

RR = 820 ms   850 ms     850 ms   875 ms   875 ms   862 ms

@ t =  0.5 s        1.0 s          1.5 s        2.0 s       2.5 s        3.0 s

 

Note that some values are repeated. Some resampling algorithms use interpolation to smooth the steps between the actual data points.

 

This resampled array could now be processed by the regular FFT or PSD VIs.

 

Lynn

0 Kudos
Message 17 of 20
(830 Views)

Hello Lynn,

Thanks for the explanation.

I sampled a pulse signal at a sample of 100Hz and processed the pulse data from which I calculated the RR intervals which are in  'seconds'(values are shown in the attached file).

Can I know how to go further wih the resampling process I mean what should I do to get PSD from these RR intervals.

Thanks.

 

 

 

0 Kudos
Message 18 of 20
(823 Views)

Hi GoviRe,

   Lynn is correct about how to resample the data. Attached is a vi which shows how to do it in LV. Also I wanted to mention that LV can run Matlab code (http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/matlab_script_node/).

 

Good luck!

0 Kudos
Message 19 of 20
(814 Views)

Here is a resample and PSD analysis of the data set you posted. Not that I removed the mean value of the data before the spectral analysis. This removes the large peak at zero frequency.

 

Look closely at the top and middle graphs on the left. The upper graph shows the RR intervals from the file plotted against index number in the file. The middle graph shows the RR intervals plotted against the time they were measured. Those times are calculated by accumulating the sum of the RR intervals. One easy place to see the difference is to look at the minimum value which appears at index 48 and time ~46.

 

Lynn

0 Kudos
Message 20 of 20
(802 Views)