LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter an irregular waveform?

Solved!
Go to solution

Hi guys,

i have a graph from 2D array data.

May i know a way to filter it to make it a smooth line at the red box area and remain the spike?

Irregular waveform.PNG

 

0 Kudos
Message 1 of 14
(4,854 Views)

You can use filters to remove the noise. High Pass, Low pass or band pass. These vi's are availble in filter pallete.


CLD Using LabVIEW since 2013
0 Kudos
Message 2 of 14
(4,839 Views)

Detect the pulse , apply a filter (FIR with half the detected pulse length) replace the pulse part with the unfiterd part ?

 

Or detect the pulse , from start to 'left'  apply a mean filter (backward) with n(TBD) points  and init the meanfilter with the pulse start value.  Do the same on the other side ...

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 14
(4,823 Views)

Hi, appreciated if you could give me some example. Attachment below is my file for x and y axis.

 

 

0 Kudos
Message 4 of 14
(4,805 Views)

Attachment is the VI of my XY graph from array

0 Kudos
Message 5 of 14
(4,792 Views)

i can not solve your filtering problem,

but i can critique your code.

 

1. please don't choose file extensions, that let you expect a format which it is not.

use either '.txt' or '.csv', NOT '.xls', this is a excel document, which your file is not.

 

2. the read-delimited-spreadsheet function, converts your strings into numbers,

there is no need to be doing it by hand

 

3. i never used the "index+bundle" function, but simply the 'bundle' function,
i don't think that the execution time matters in your case, but it might be if you have larger datasets (bundle only takes 60% of the time index+bundle takes (+- variation).

 

xy-graph-bundle-or-indexbundle.png

(this is a snippet, download the .png file from below and drag+drop it onto a blockdiagram)

 

regarding your problem, take the already given suggestions, and play a little with all the filtering VIs.

e.g. search for "butterworth filter" and then try lowpass and change the sampling frequency.

find out how to display multiple plots in one xy-graph (search for "xy graph" in labview's example finder) so you can compare your filtered result with the original.

 

have fun

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 6 of 14
(4,781 Views)
Solution
Accepted by oliver1023

Hi oliver1023,

 

I'm not going to implement the fix for you. However, I will point out the functions that I would use to solve this challenge. If we break it down in to sections:

  1. We are interested in the peak - that's our focal point, so lets isolate that that. To to this, we can use the Peak Detector function.
  2.  Peak Detector.JPG
    1. This function will tell us what the peak is and where it is. Enter a threshold level and this function will return an array of values.
  3. You want to smooth out everything except for the peak.
    1. Considering we have all the information about the peak, we can be cheeky and actually filter everything (including the peak), then add the peak back in later.
    2. To filter your signal use the Butterworth Filter - this can be set to bandpass
    3. Butterworth.JPG

I hope this has given you some food for thought!

Message 7 of 14
(4,771 Views)

To apply a meaningful signal processing, it is important to know why you need to make that areas flat?

What is the goal?   What is the physics behind?

 

If you 'just' want to calculate the pulshight to the biased level, there are faster/easyer/better ways to do it:   

  • detect peak value, 
  • fit a line with weightningfilter leaving out the peak ,(smoth to the ends, use prior knowledge..)
  • calc distance of peak to line

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 8 of 14
(4,763 Views)

Lazy sunday ...  don't know if that's the task you need, however

here is something to play

unbias peak.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 9 of 14
(4,745 Views)

Hi jwscs,

 

Noted of all the error I've done that you pointed out.

I will update my main code.

 

Thanks with appreciation.

 

0 Kudos
Message 10 of 14
(4,721 Views)