wavelet returns different length signal than input

Skoðað 180 sinnum
Fara í fyrstu ólesnu skilaboð

Martin Mashalov

ólesið,
28. jún. 2022, 10:59:4728.6.2022
til PyWavelets
Hello, 

I am a beginner with wavelets which I am currently using to decompose stock price signal data. I am inputting a signal with 1502 entries but get an array with 1504 entries. 

Since I need the output signal to be of the same length, how should I handle the extra values? Should I just remove the first values? Any help would be much appreciated. 

Thank you. 

Martin
Skilaboðum hefur verið eytt

Deepu

ólesið,
22. maí 2023, 02:21:0522.5.2023
til PyWavelets
When performing wavelet decomposition on a signal, it is common to obtain a different length for the approximation and detail coefficients compared to the original signal. This is because wavelet decomposition involves filtering and downsampling operations.

To handle the difference in length, you have a few options:

1. Trim the coefficients: If you want the output signal to have the same length as the original signal, you can simply remove the additional values from the coefficients. For example, if you obtain an approximation coefficient and detail coefficients with lengths 1504, you can trim them to 1502 by removing the first two values.

2. Upsample the coefficients: If maintaining the original length of the signal is critical for your analysis, you can choose to upsample the coefficients to match the length of the original signal. Upsampling involves inserting additional values into the coefficient arrays, typically using interpolation techniques. However, keep in mind that this approach may introduce some artifacts or loss of information.

3. Adjust the decomposition level: Another option is to adjust the decomposition level to obtain coefficients of a desired length. The number of decomposition levels determines the number of coefficient arrays obtained. By increasing or decreasing the decomposition level, you can potentially achieve a desired length for the coefficients. However, this may also affect the frequency resolution and level of detail captured in the decomposition.

The choice of how to handle the extra values depends on your specific requirements and the nature of your analysis. If preserving the exact length of the original signal is crucial, you may consider trimming or upsampling the coefficients accordingly. Experimentation and analysis of the results can help you determine the most appropriate approach for your specific application.

I hope this helps! Let me know if you have any further questions.
Svara öllum
Svara höfundi
Senda áfram
0 ný skilaboð