The filter-Hilbert method

Поділитися
Вставка
  • Опубліковано 25 лип 2024
  • This video lesson is part of a complete course on neuroscience time series analyses.
    The full course includes
    - over 47 hours of video instruction
    - lots and lots of MATLAB exercises and problem sets
    - access to a dedicated Q&A forum.
    You can find out more here:
    www.udemy.com/course/solved-c...
    For more online courses about programming, data analysis, linear algebra, and statistics, see
    sincxpress.com/
  • Наука та технологія

КОМЕНТАРІ • 32

  • @tobi3497
    @tobi3497 4 роки тому

    Great video. I was trying to do something similar - as opposed to morlet wavelets with a gaussian frequency resolution

  • @tengs_penkwe
    @tengs_penkwe 4 роки тому

    Clear Explanation

  • @user-hk3ej4hk7m
    @user-hk3ej4hk7m 2 роки тому +2

    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?

  • @vokincho
    @vokincho 3 роки тому +2

    I'm wondering why you're saying that applying a FIR filter is not formally a convolution. Could you please explain?

  • @matteldcar
    @matteldcar 4 роки тому

    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?

    • @mikexcohen1
      @mikexcohen1  4 роки тому +2

      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.

    • @matteldcar
      @matteldcar 4 роки тому

      Thanks for the reply, got it!

  • @Upperhorny
    @Upperhorny 3 роки тому

    Hey Mike -I´ve got a question: When I do the Hilbert transform (broadband) of a saw wave, it seems like it doesnt give me the envelope anymore, but a very funny signal. is there a way around it ? like a "Envelope-Hilbert-Transform"? I know you said Hilbert is for narrowband signals, but is there a way of getting the envelope with a broadband signal ?
    BTW your videos are by far the best on youtube! please keep up the great work!

    • @mikexcohen1
      @mikexcohen1  3 роки тому

      Thank you, Void, I'm glad you're finding these useful.
      Saw waves have energy at many frequencies, and the envelope will reflect the power at whatever frequency has the most power at each time point. In principle, you can narrowband filter the signal, but I don't know if that's really sensible for a saw wave time series.

  • @vagabond683
    @vagabond683 4 роки тому +1

    How narrowband is narrow enough to use Hilbert without filtering first?

    • @mikexcohen1
      @mikexcohen1  4 роки тому +1

      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.

  • @zmlin
    @zmlin 4 роки тому

    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?

    • @mikexcohen1
      @mikexcohen1  4 роки тому +1

      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.

    • @zmlin
      @zmlin 4 роки тому

      @@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.

    • @mikexcohen1
      @mikexcohen1  4 роки тому +1

      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.

    • @zmlin
      @zmlin 4 роки тому

      @@mikexcohen1 Thank you!!

  • @jyanguas3251
    @jyanguas3251 Рік тому

    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!

    • @mikexcohen1
      @mikexcohen1  Рік тому +1

      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.

    • @jyanguas3251
      @jyanguas3251 Рік тому

      @@mikexcohen1 thats what I thought
      Thank you!

  • @rodrigo100kk
    @rodrigo100kk 2 роки тому

    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.

  • @babotvoj
    @babotvoj 3 роки тому

    why does the FIR hilbert filter has a sawtooth phase in frequency domain?

    • @mikexcohen1
      @mikexcohen1  3 роки тому

      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.

  • @tobi3497
    @tobi3497 4 роки тому +1

    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*

    • @mikexcohen1
      @mikexcohen1  4 роки тому

      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.

    • @tobi3497
      @tobi3497 4 роки тому

      @@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

    • @tobi3497
      @tobi3497 4 роки тому

      @@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

    • @mikexcohen1
      @mikexcohen1  4 роки тому

      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.

    • @tobi3497
      @tobi3497 4 роки тому

      @@mikexcohen1 Do you have a series including FIR with least squares?

  • @chloeqin505
    @chloeqin505 2 роки тому

    Mr. Infinite impulse response.. lmao

    • @mikexcohen1
      @mikexcohen1  2 роки тому +1

      Yes, truly one of humanity's great geniuses ;)