Thanks uploading this! However I think there's a bit of confusion regarding what the Hilbert transform yields as a result. If I'm not mistaken, the analytical function is the original function, plus i times the Hilbert transform of it. The Hilbert transform doesn't yield the entire analytical function, but only its complex part. Is this correct?
Is it possible to not only band-pass filter, but apply a variable attenuation to the power of each frequency in the band, using a method like filter-hilbert. My instinct was to simply apply an gain-envelope over the frequency spectrum, however, this doesn't seem like it would work as expected. Mainly because the Gilbert transform works by doubling the low end of the FFT spectrum, which results in a unique transformation of the signal, not in the doubling of all frequency powers. So, applying an envelope over the signal will equivalent result in a unique transformation of the signal - not the desired attenuations of each frequency power over time. Essentially, something like: *abs(half_power(hilbert(narrow_banded_signal))) = abs(hilbert(narrow_banded_signal)) / 2*
Yes, you can create any arbitrary shape of the filter you want. That's an advantage of FIR over wavelets for narrowband filtering. The interpretation gets trickier with the Hilbert transform. The analytic signal resulting from the Hilbert transform will reflect whatever frequency has the most power at that time point. So if the filter itself biases the signal towards some frequency, then the analytic amplitude and phase will be dominated by that frequency. That's not necessarily a problem, but seems a bit suboptimal. My intuition is that it's best to have either (1) a flat spectrum across some range, or (2) a symmetric peak around some frequency of interest. An asymetric filter would introduce a systematic bias in the spectral content of the results, which is something I'd prefer to avoid.
@@mikexcohen1 some of that has gone over my head, as I'm not too knowledgeable in this field, but what I'm trying to do is exponentially attenuate higher frequencies - to give a more representative diagram for audio spectrograms (humans hear higher frequencies less than low). The end goal is to actually apply an actual human frequency envelope to the frequency spectrum (as opposed to a basic exponential line) to nearly exactly match how a human would hear the frequencies. Side note I watched some videos from the new PlayStation 4 teasers where they talk about advancements in their real time audio processing in games. In here, they use envelopes calculated empirically calculated (unique to each person's ear) to provide more realistic 3d/audio
@@mikexcohen1 to sum. It seems your concern is that this will introduce bias for certain frequencies - but this is exactly what I'm trying to introduce, to match human hearing
I very much like the theory of it. In practice, I don't think it's great for typical neuroscience data (LFP, EEG, MEG). In my experience, the results are too dependent on minor choices of filters, e.g., a low-pass filter of 90 vs 100 Hz can change the estimates of spectral dynamics at 10 Hz. I think the HH method is best suited for signals that have most of the energy concentrated in very narrow ranges.
Good question. That's difficult to say because it depends on the characteristics of the data to some extent. But generally, a band of several Hz is probably a good range. For example, 6-8 Hz.
Great video! I have a question. How do you get the time-frequency power plot with this Hilbert method? For the time, we have to apply the Hilbert transform to each segment, right? While, for the frequency, do we need to compute a filter in each step? to get the different frequency components Thank you!
You first narrowband filter the data, then apply the Hilbert transform, then extract the power time series. That creates one row in the TF plot. Then repeat for however many frequencies you want.
Phase values are undefined when power is zero. In practice, on digital computers, the power spectrum isn't true zero, but some really tiny numbers due to rounding errors. So those phase values are not interpretable.
Hi Mike, great to see a whole new series of videos out! I have a question regarding preprocessing, when one's purpose is to perform time-frequency analyses on a specific narrow frequency band, either based on power or phase. Would you say that it is better to skip the 'traditional' preprocessing filtering steps (hi-pass / low-pass / band-stop at 50 or 60Hz) and apply a narrow-band FIR filter alone on the raw signal correcting for phase-shifts? If not, what is the added value of applying the above mentioned filters during the stage of pre-processing?
You don't need those extra filters for the time-frequency analysis, but those preprocessing steps will improve the ICA decomposition, which in turn will give you cleaner data. So it's still a good idea.
Hi Mike, my bandwidth of interest is essentially all the major frequency bands (0.1-50hz). In terms of wavelet parameters, should I set my min_freq = 0.1 and max_freq = 50? or min_freq = 1 is enough?
Hi Zhongmin. It sounds like an FIR filter might be a better option for you, considering the wide band. If you want to use wavelets, you'll need to have multiple wavelets spanning that range. Maybe 20 or 30 wavelets will suffice.
@@mikexcohen1 Thanks Mike! I think I can FIR filter it in preprocessing (is 0.1-50hz ok or do I need more like 0.1-100hz?) to get better ICA results. And by the way, do you have any recommendations on doing TF decomposition on signals with long time duration? My task A take 40s and B takes 60s, and I am trying to compare them.
Time-frequency decomposition is mainly useful if you expect temporal dynamics that are time-locked to some event. For really long time periods, it might be better to do something like Welch's method and compare the spectra. That's essentially equivalent to doing a time-frequency analysis and then averaging over all time points.
Another way to see it is imagine that the negative amplitudes in the frequency domain are multiplied by -1 and then added to the positive amplitudes. So you actually double the signal.
Thanks uploading this! However I think there's a bit of confusion regarding what the Hilbert transform yields as a result. If I'm not mistaken, the analytical function is the original function, plus i times the Hilbert transform of it. The Hilbert transform doesn't yield the entire analytical function, but only its complex part. Is this correct?
AS you add more taps you also get more delay. The same applies for the steepness of the filter.
Indeed. Great point. On the other hand, if you're doing offline filtering, then a zero-phase-shift filter will handle the additional delays.
I'm wondering why you're saying that applying a FIR filter is not formally a convolution. Could you please explain?
Is it possible to not only band-pass filter, but apply a variable attenuation to the power of each frequency in the band, using a method like filter-hilbert. My instinct was to simply apply an gain-envelope over the frequency spectrum, however, this doesn't seem like it would work as expected. Mainly because the Gilbert transform works by doubling the low end of the FFT spectrum, which results in a unique transformation of the signal, not in the doubling of all frequency powers. So, applying an envelope over the signal will equivalent result in a unique transformation of the signal - not the desired attenuations of each frequency power over time. Essentially, something like: *abs(half_power(hilbert(narrow_banded_signal))) = abs(hilbert(narrow_banded_signal)) / 2*
Yes, you can create any arbitrary shape of the filter you want. That's an advantage of FIR over wavelets for narrowband filtering. The interpretation gets trickier with the Hilbert transform. The analytic signal resulting from the Hilbert transform will reflect whatever frequency has the most power at that time point. So if the filter itself biases the signal towards some frequency, then the analytic amplitude and phase will be dominated by that frequency. That's not necessarily a problem, but seems a bit suboptimal. My intuition is that it's best to have either (1) a flat spectrum across some range, or (2) a symmetric peak around some frequency of interest. An asymetric filter would introduce a systematic bias in the spectral content of the results, which is something I'd prefer to avoid.
@@mikexcohen1 some of that has gone over my head, as I'm not too knowledgeable in this field, but what I'm trying to do is exponentially attenuate higher frequencies - to give a more representative diagram for audio spectrograms (humans hear higher frequencies less than low). The end goal is to actually apply an actual human frequency envelope to the frequency spectrum (as opposed to a basic exponential line) to nearly exactly match how a human would hear the frequencies. Side note I watched some videos from the new PlayStation 4 teasers where they talk about advancements in their real time audio processing in games. In here, they use envelopes calculated empirically calculated (unique to each person's ear) to provide more realistic 3d/audio
@@mikexcohen1 to sum. It seems your concern is that this will introduce bias for certain frequencies - but this is exactly what I'm trying to introduce, to match human hearing
I see. Then yes, go for an FIR filter. You can use an algorithm like firls and use, e.g., 15 points to specify the shape of the spectrum.
@@mikexcohen1 Do you have a series including FIR with least squares?
Great video. I was trying to do something similar - as opposed to morlet wavelets with a gaussian frequency resolution
What do you think of Hilbert-Huang transform ?
I very much like the theory of it. In practice, I don't think it's great for typical neuroscience data (LFP, EEG, MEG). In my experience, the results are too dependent on minor choices of filters, e.g., a low-pass filter of 90 vs 100 Hz can change the estimates of spectral dynamics at 10 Hz. I think the HH method is best suited for signals that have most of the energy concentrated in very narrow ranges.
How narrowband is narrow enough to use Hilbert without filtering first?
Good question. That's difficult to say because it depends on the characteristics of the data to some extent. But generally, a band of several Hz is probably a good range. For example, 6-8 Hz.
Great video!
I have a question. How do you get the time-frequency power plot with this Hilbert method? For the time, we have to apply the Hilbert transform to each segment, right? While, for the frequency, do we need to compute a filter in each step? to get the different frequency components
Thank you!
You first narrowband filter the data, then apply the Hilbert transform, then extract the power time series. That creates one row in the TF plot. Then repeat for however many frequencies you want.
@@mikexcohen1 thats what I thought
Thank you!
why does the FIR hilbert filter has a sawtooth phase in frequency domain?
Phase values are undefined when power is zero. In practice, on digital computers, the power spectrum isn't true zero, but some really tiny numbers due to rounding errors. So those phase values are not interpretable.
Hi Mike, great to see a whole new series of videos out!
I have a question regarding preprocessing, when one's purpose is to perform time-frequency analyses on a specific narrow frequency band, either based on power or phase. Would you say that it is better to skip the 'traditional' preprocessing filtering steps (hi-pass / low-pass / band-stop at 50 or 60Hz) and apply a narrow-band FIR filter alone on the raw signal correcting for phase-shifts? If not, what is the added value of applying the above mentioned filters during the stage of pre-processing?
You don't need those extra filters for the time-frequency analysis, but those preprocessing steps will improve the ICA decomposition, which in turn will give you cleaner data. So it's still a good idea.
Thanks for the reply, got it!
Hi Mike, my bandwidth of interest is essentially all the major frequency bands (0.1-50hz). In terms of wavelet parameters, should I set my min_freq = 0.1 and max_freq = 50? or min_freq = 1 is enough?
Hi Zhongmin. It sounds like an FIR filter might be a better option for you, considering the wide band. If you want to use wavelets, you'll need to have multiple wavelets spanning that range. Maybe 20 or 30 wavelets will suffice.
@@mikexcohen1 Thanks Mike! I think I can FIR filter it in preprocessing (is 0.1-50hz ok or do I need more like 0.1-100hz?) to get better ICA results.
And by the way, do you have any recommendations on doing TF decomposition on signals with long time duration? My task A take 40s and B takes 60s, and I am trying to compare them.
Time-frequency decomposition is mainly useful if you expect temporal dynamics that are time-locked to some event. For really long time periods, it might be better to do something like Welch's method and compare the spectra. That's essentially equivalent to doing a time-frequency analysis and then averaging over all time points.
@@mikexcohen1 Thank you!!
Another way to see it is imagine that the negative amplitudes in the frequency domain are multiplied by -1 and then added to the positive amplitudes. So you actually double the signal.
thanks for saving me 23 min lol
Clear Explanation
Mr. Infinite impulse response.. lmao
Yes, truly one of humanity's great geniuses ;)