JuliaDSP / Wavelets.jl

A Julia package for fast discrete wavelet transforms and utilities
Other
185 stars 30 forks source link

Relax Dyadic requirement #8

Closed agbristol closed 9 years ago

agbristol commented 9 years ago

Hi,

I've been working on a patch which relaxes the requirement that the signals have dyadic support, in favour of a "sufficient powers of 2" test. To compute an n-level transform, the support of the signal needs only to have 2^n as a factor. I've completed the modifications and tested them on an older version of the package, before the significant changes which have been made of the last couple of months.

The reason for this issue is this: If I integrate these changes into the current version of the package, are you likely to accept them? (Assuming you're happy with the technical quality?)

And a further question: Do you plan any further significant changes to the API soon? Ought I to wait for some upcoming change before rebasing my work?

Thanks

Andy

gummif commented 9 years ago

Having non-dyadic length transforms is a great addition. There are no API changes currently on the horizon, so you are welcome to contribute. edit: I just merged refactored code for filters that might influence your code.

agbristol commented 9 years ago

The changes made to filtdown and filtup seem, at a glance, quite involved. The method I've implemented simply replaces the isdyadic() assertion with a sufficientpowersoftwo() method, which takes the level of the transform into account. The inner loops are not modified, but filtup can have an input whose length is odd, and filtdown can have output whose length is odd. My main concern is that filtup and filtdown can handle these odd-length sequences. I'd rather not have to check this by hand again. As you've recently reviewed the code, do you think filtup and filtdown in their new forms will work correctly with odd-length input and output, respectively?

(There is an easier way around this, which is to check for an additional power of two in the length of the input signal. But that seems like a bit of a hack...)

gummif commented 9 years ago

The modified versions should handle input and output lengths exactly the same way as the old versions did (I assume). The revision concerned splitting the loops into filtering on boundaries and inbounds filtering.