Skip to content

Continuous Wavelet Transform Crashes for Complex Inputs #51

Description

@mattcbro

My use case for wavelets involves analyzing complex baseband signals like chirps and tones.
This crashes the wavelet transform, e.g.

 yt = cwt(chirp, wave)
┌ Warning: the lowest frequency wavelet has more than 1% its max at zero, so it may not be analytic. Think carefully
│   lowAprxAnalyt = 0.050211
└ @ ContinuousWavelets ~/.julia/packages/ContinuousWavelets/pycif/src/sanityChecks.jl:7
ERROR: DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 4096 and 2049
Stacktrace:
  [1] _bcs1
    @ ./broadcast.jl:555 [inlined]
  [2] _bcs
    @ ./broadcast.jl:549 [inlined]
  [3] broadcast_shape
    @ ./broadcast.jl:543 [inlined]
  [4] combine_axes
    @ ./broadcast.jl:524 [inlined]
  [5] instantiate
    @ ./broadcast.jl:306 [inlined]
  [6] materialize
    @ ./broadcast.jl:903 [inlined]
  [7] analyticTransformComplex!(wave::Array{…}, daughters::Matrix{…}, x̂::Matrix{…}, fftPlan::FFTW.cFFTWPlan{…}, averagingType::NoAve)
    @ ContinuousWavelets ~/.julia/packages/ContinuousWavelets/pycif/src/apply.jl:172
  [8] cwt(Y::Vector{…}, cWav::CWT{…}, daughters::Matrix{…}, fftPlans::Int64)
    @ ContinuousWavelets ~/.julia/packages/ContinuousWavelets/pycif/src/apply.jl:56
  [9] cwt
    @ ~/.julia/packages/ContinuousWavelets/pycif/src/apply.jl:23 [inlined]
 [10] #cwt#21
    @ ~/.julia/packages/ContinuousWavelets/pycif/src/apply.jl:240 [inlined]
 [11] cwt(Y::Vector{ComplexF64}, c::CWT{SymBoundary, Float64, Morlet, Float64, true})
    @ ContinuousWavelets ~/.julia/packages/ContinuousWavelets/pycif/src/apply.jl:236
 [12] top-level scope
    @ /data/projects/Airanaculus/GPSSignalClass/signalclass.jl:38
Some type information was truncated. Use `show(err)` to see complete types.

chirp is a length 2048 complex chirp signal.

I think I can work around this by separately taking the cwt() operation of the real and imaginary parts, but I don't see why these transforms don't work out of the box on a complex vector.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions