Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An empirical scaling factor #4

Open
RainyMeadows opened this issue Dec 24, 2023 · 1 comment
Open

An empirical scaling factor #4

RainyMeadows opened this issue Dec 24, 2023 · 1 comment

Comments

@RainyMeadows
Copy link

I was going through your code to see how close my tries to reconstruct the figures in the book went, and line 190 in chapter12.m caught me by surprise.

Firstly, feeding n_conv to ift is extraneous since both our inputs have been constrained to have n_conv time-points. Secondly, what explains the downscaling by a factor of 10?

@mikexcohen
Copy link
Owner

Hi Rainy. I probably discuss these in the book or online videos. The spectra do need to have the same lengths for the multiplication. The inverse FT does not need to be n_conv points long; that's a parameter you can set, for example if you want to upsample via sinc-interpolation. The second input to ifft defaults to the length of the spectrum, so explicitly including n_conv here is done as a reminder of the mechanics of convolution.

The scaling factor is for visualizing the wavelet and filter results in the same graph. Normalizing wavelets is a bit tricky, and I discuss it in more detail elsewhere (briefly: the best way to normalize wavelets is by max-amplitude unit normalizing in the frequency domain; I don't do that in this chapter in the interest of simplicity). Actually, normalizing filter kernels is also a bit tricky, but MATLAB handles that for us :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants