rafat / wavelib

C Implementation of 1D and 2D Wavelet Transforms (DWT,SWT and MODWT) along with 1D Wavelet packet Transform and 1D Continuous Wavelet Transform.
Other
375 stars 121 forks source link

wavelet packet decomposition #5

Open SantiagoLunaRomero opened 7 years ago

SantiagoLunaRomero commented 7 years ago

if you compare your code with the funtion "wpdec()" in matlab. What is the diference?

fredericodamian commented 7 years ago

Hi, I'm using this library to implement a project that once was implemented in Matlab. I'd validated it uses but it has a few differences:

Matlab "appcoef" returns the recomposition of "wavedec" decomposition, using the Wavelet parameters you choosed. When you return your "appcoef" results, it will show (N + 5) samples, 'N' as 1/(2^s) of total samples you enter in "wavedec" function and 's' the scale order you choosed to recompose.

Using this library, when you recompose your signal, it will return the same number of samples, but in fact, only the N/(2^s) is the recomposition data.

I don't know if this library has an option to fix it automatically, since I just began to use Wavelet and this library.

Hope it helps. Regards.

rafat commented 7 years ago

Hi,

Can you send me the code so I can replicate the issue ? This could be because of the type of extension choosen as symmetric and preiodic extensions will return different size.

Rafat

On 2/23/17, fredpreve notifications@github.com wrote:

Hi, I'm using this library to implement a project that once was implemented in Matlab. I'd validated it uses but it has a few differences:

Matlab "appcoef" returns the recomposition of "wavedec" decomposition, using the Wavelet parameters you choosed. When you return your "appcoef" results, it will show (N + 5) samples, 'N' as 1/(2^s) of total samples you enter in "wavedec" function and 's' the scale order you choosed to recompose.

Using this library, when you recompose your signal, it will return the same number of samples, but in fact, only the N/(2^s) is the recomposition data.

I don't know if this library has an option to fix it automatically, since I just began to use Wavelet and this library.

Hope it helps. Regards.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rafat/wavelib/issues/5#issuecomment-281891257

fredericodamian commented 7 years ago

Hello. I appreciate that you answer me! By the way, thank you very much for the library, It helped me a lot.

Yes, I used symmetric config. I took directly from the dwt example. I knew I was doing something wrong.

Again, thank you very much! Regards!

Em 24 de fev de 2017 6:49 AM, "Rafat Hussain" notifications@github.com escreveu:

Hi,

Can you send me the code so I can replicate the issue ? This could be because of the type of extension choosen as symmetric and preiodic extensions will return different size.

Rafat

On 2/23/17, fredpreve notifications@github.com wrote:

Hi, I'm using this library to implement a project that once was implemented in Matlab. I'd validated it uses but it has a few differences:

Matlab "appcoef" returns the recomposition of "wavedec" decomposition, using the Wavelet parameters you choosed. When you return your "appcoef" results, it will show (N + 5) samples, 'N' as 1/(2^s) of total samples you enter in "wavedec" function and 's' the scale order you choosed to recompose.

Using this library, when you recompose your signal, it will return the same number of samples, but in fact, only the N/(2^s) is the recomposition data.

I don't know if this library has an option to fix it automatically, since I just began to use Wavelet and this library.

Hope it helps. Regards.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rafat/wavelib/issues/5#issuecomment-281891257

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rafat/wavelib/issues/5#issuecomment-282249819, or mute the thread https://github.com/notifications/unsubscribe-auth/ARGVxm3-PH2I5uE3WjvLF0_b-y9HRpgyks5rfqergaJpZM4LaSPn .

zhanghonglang commented 5 years ago

The dwttest result is different from pywt result image image

rafat commented 5 years ago

You should get the same results if you are using the same wavelet, levels of decomposition and signal extension.

Figure 2) is the actual DWT detail coefficients.

Figure 3) is the actual DWT approximation coefficients.

The first figure is the reconstructed approximation and detail coefficients over a single branch so that they each have the same length and can be used for signal analysis. You should be able to view the actual coefficients using the dropdown menu of the graph. For example, "Details at level 1" etc.

Rafat

https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=8aa13abc-7b06-4499-af86-2eee179ffd91 I’m protected online with Avast Free Antivirus. Get it here — it’s free forever. https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=8aa13abc-7b06-4499-af86-2eee179ffd91 <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Mon, Jul 1, 2019, 13:48 zhanghonglang notifications@github.com wrote:

The dwttest result is different from pywt result [image: image] https://user-images.githubusercontent.com/13651762/60421149-d13d0d00-9c1b-11e9-8eb8-ce22708e7346.png [image: image] https://user-images.githubusercontent.com/13651762/60421010-8622fa00-9c1b-11e9-8747-3edd9e25974b.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rafat/wavelib/issues/5?email_source=notifications&email_token=AAI3RO27MLIX6KNB4LCT7NLP5G4WJA5CNFSM4C3JEPT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY5LUYQ#issuecomment-507165282, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI3RO6DJGXIJNMUZJMRQ23P5G4WJANCNFSM4C3JEPTQ .