-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customize frequency bands for frequency-based analysis? #90
Comments
@KathMaki Although there isn't a specific way to modify the VLF, LF, and HF right now through the hp functions (although you could fork your own source code), I think your best bet is to use the raw 'psd' and 'frq' information stored in the working data output of the process function. If you want FFT output you would specify the following options in your process or process_segmentwise argument:
You would essentially be saving two lists containing the raw FFT data for each segment. These then could be used to calculate your own LF or HF bands according to the murine HRV literature :) See the following source code I've slightly modified as an example:
Based on what you are saying it is also a good idea to modify the BPM min and max arguments so that no erroneous peak rejection happens to your data (although you've probably already sorted this out). Happy hunting! |
Thank you for the response and help with the source code! To be clear, are you saying for process_segmentwise if I wanted to process each hour at a time and use 5 min segments with 50% overlap I would use this code (after subsetting the data by hour): And if I wanted to use 10 min segments I would use this: Do you recommend replacing outliers as a default? My signal is clean and so far there haven't been issues with peak detection but curious what you think about this. In regards to the FFT portion: Finally, I am used to seeing LF and HF power reported in ms^2 in the literature. I see with the calc_fd_measures, there is a square_spectrum option that would give me the output I am used to seeing (I believe). But if I am going to be accessing the raw fft data to calculate my own frequency bands based on the rat literature, would it be best to get the data in ms and then square the results at the end or would it be cleaned to get the output squared from the beginning since that is how I usually see it reported? Again, thank you so much! |
Thanks for a great program. I am currently analyzing rat data where HRs are much higher vs. human (~300-450 bpm at times). In the literature, frequency bands are different for rodents as compared to humans. I have seen LF ranges around 0.2-0.8 Hz and 0.15-1.5 Hz, HF ranges have been reported as 0.8-2.8 Hz and 1.5-5 Hz
Is it possible to add a dictionary or flag to customize the frequency bands so I can use the freq or process functions for my HRV analysis?
Additionally, I have ~24 hour recordings for each intervention day (I use aortic BP but the peak-peak detection has been working well in your program).
My thought is to first segment out the signal files by hour (i.e. so only 8am values are calculated then 9am etc.) and then use a sliding window of 3-4 minutes (as heart rates are higher so more beats are obtained) using "process_segmentwise" to calculate the HRV parameters. My goal is to have one mean HRV value (for my metrics of interest) for each hour, per animal. Does this seem appropriate? Thanks in advance!
The text was updated successfully, but these errors were encountered: