03-10-2009 12:15 PM
Hello everyone,
I am measuring pulse rate to analyse HRV. I am at a stage where I have a time domain signal which I convert to frequenct domain to measure Power Spectral DEnsity and power in specific freuency range.
I have split the frequency domain signal (0 - 0.5 Hz) into three components 0 - 0.04 Hz, 0.04 -0.15Hz and 0.15 to 0.4Hz
I now need to calculate power of these signals and not sure which VI to use.
Also when I plot these three signals to give the overall signal with different colours (has been discussed in a number of posts earlier), this slows my execution and I cant affordit as I am analysing real time.
The way I have done this is-
Take the signal components from an array (by specifying index and length)
Insert these into an array where other than interested range, the rest is NaN
Create a waveform of these three components
Merge waveforms to one plot
How shall I make this execution faster?
03-11-2009 08:36 AM - edited 03-11-2009 08:37 AM
Hi,
The poor performance is more likely caused by how you build your array and loop structures. The colouring effect on your graph isn't really computational intensive.
There are many different ways to measure the power. For example, you can use "Amplitude and Level Measurements" express VI to quickly measure the RMS and peaks.
03-11-2009 09:22 AM
Thanks Mark,
I have attached a snapshot of the bit of code that does the above. Could you help me point what I can do to make the execution faster?
03-11-2009 11:25 AM
Hi,
I can see your code is generating a lot of unnecessary copies of the same array, hence there are a lot of memory read/write opeartion that slows down the execution.
You may want to optimise your code and take the advantage of using "Inplace" algorithms. A good point to start learning how to use "inplace" is from this presentation: Improving the Performance of Your LabVIEW Applications.
I hope this helps,