03-14-2019 12:07 PM
Mcduff, I think my vi does the same thing as yours.. I tried to apply what you told me and this is what I get..
03-14-2019 12:16 PM
Not sure what you are asking. Your frequencies are off from real values, because you have a dt of 1 in your data.
mcduff
03-14-2019 12:26 PM
Mmm true... but I need that dt to show the location in time of the peaks!
I'm confused now
03-14-2019 12:35 PM
So, do a conversion from a dt of 1 to the real dt. Then peaks will be in real time and you can convert.
03-15-2019 03:59 PM
Did you figure it out yet? You can try adding this to your analysis.
mcduff
03-18-2019 05:01 AM
Hello mcduff, my code does the same as your analysis, my dt isn't 1 but 0.0006 (I checked it with an indicator).
My problem seems to be that I'm not filtering in the right way.
Thank you for your interest!
03-18-2019 08:25 AM - edited 03-18-2019 08:29 AM
OK, I'm looking at the signal you are showing, which shows about 10k samples at 5.5, about 15k samples that have slow wave and 50 Hz negative pulses, and about 8k samples mostly near -5. I'm "guessing" that you are using 50 Hz power (as opposed to my devices plugged into 60 Hz power) and that your acquisition system is unshielded or improperly grounded (you aren't recording "single-ended", are you?). I'm also guessing that the relatively slow fluctuations (ignoring the negative pulses) are the signal you are trying to study.
Although I'm not an engineer, I learned at an early age that you want to start with as clean a signal (no "mains" noise, for example) as you can before you try to filter out "noise" (eliminating noise before you sample is always best). For your signal, I would start by carefully examining the signal to see if my supposition that it is contaminated with a largely-negative narrow pulse at (almost exactly) 50 Hz. Let me assume that this is true. I would make the following recommendations:
I would hope you'd be able to write the code in Step 3 by yourself. Do try -- if you get stuck, attach your entire VI and come back and show your efforts. But it is most important that you do the first step of identifying (and, I hope, eliminating) the noise before trying a post-acquisition low-pass "decimating" filter (I call it that because it will replace you 35000-point record with 100-200 points).
Bob Schor
03-18-2019 08:39 AM
@deuchi wrote:
Hello mcduff, my code does the same as your analysis, my dt isn't 1 but 0.0006 (I checked it with an indicator).
If I use a dt of 0.0006 I get a ~5 Hz rate between beats, much too fast for a heart beat, but is this a simulation.
mcduff
03-18-2019 12:02 PM
Bob_Schor, thank you for the detailed explanation. My signal,as you said, was very noisy and it was due to the circuit I was using. Now I have improved my circuit (and my code) which I'm attaching it here.
Is it ok the way the code is written?
03-18-2019 12:04 PM
Now I'm filtering with an analogical filter (Butterworth)... I actually wanted to use the digital filters, the IIR for example, but my knowledge about them isn't that big...