Skip to content

Adaptive sampling of wavelets #4

Open

Description

@jchutrue

At the lower frequencies, we need more samples to get an accurate representation of the wavelet, but at higher frequencies, we need fewer. I need to figure out a better way of sampling the wavelets rather than the default of 16000 samples or so.

Activity

  1. ckemere commented on Apr 18, 2019

    @ckemere

    I'm confused. I always define the root wavelet (i.e., scale = 1), which corresponds to something close to the highest frequency being sampled. Lower frequencies are just stretched versions of this. The duration of the wavelet should scale with increasing scale (decreasing frequency)?

  2. jchutrue commented on Apr 18, 2019

    @jchutrue
    MemberAuthor

    Hmm I was doing it backward, where I computed the number of points that the lowest frequency wavelet needed to be sampled sufficiently. I set this level to be 1. Then for example, if the frequency doubled, the number of samples should be halved.

    For the example I was testing, the lowest frequency was around 0.15 Hz and needed 25000 points. At 150 Hz, my strategy said I only need 25, but when I checked the wavelet's representation, it was definitely undersampled

  3. ckemere commented on Apr 18, 2019

    @ckemere

    This is the benefit of the "scales"-focused approach. In your example, you might have been undersampling 0.15Hz without realizing.

  4. jchutrue commented on Apr 18, 2019

    @jchutrue
    MemberAuthor

    You are correct. The wavelet implementation I adapted my code around dealt only with frequencies, not scales. I'll take another look at the Morse papers and see what they did.

  5. jchutrue commented on Apr 18, 2019

    @jchutrue
    MemberAuthor

    There's a formula here that is analogous to the temporal bandwidth:
    https://royalsocietypublishing.org/doi/pdf/10.1098/rspa.2016.0776

    See equation 2.8. From preliminary tests, about 4 times this value seemed to give sufficient sampling. I'll go verify on the lowest frequencies too.

  6. ckemere commented on Apr 19, 2019

    @ckemere

    The whole point of the wavelet is that you convolve with h( (t -a)/b) ). b is the scale. So if the wavelet h(t) is time limited, it should be time limited the same amount regardless of scale. Equation 2.8 is just saying this. I don't understand why you don't just use scale internally???

  7. jchutrue commented on Apr 19, 2019

    @jchutrue
    MemberAuthor

    From a maintenance perspective, I find frequencies easier to work with, and this is how Lilly's own Morse wavelet package is implemented. In fact, all of the functions I've adapted use normalized radians, not scales.

    Internally for the transform object, I do scale the number of wavelet samples by the ratio of the frequencies to the mother wavelet peak frequencies, per equation 2.8.

    This adaptive wavelet sampling based on the scale/frequency is now up on the develop and unstable branches, and is working. You can also specify a voices_per_octave argument like MATLAB's cwt function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions