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

scale to frequency #28

Open
Junyinghouse opened this issue Dec 14, 2020 · 1 comment
Open

scale to frequency #28

Junyinghouse opened this issue Dec 14, 2020 · 1 comment

Comments

@Junyinghouse
Copy link

Hi Sir,

Apologies, I sent the email below already, but just thought I'd repost here for others.

I have used cwt in wavelib to perform time frequency analysis. Parameters were set as exactly same as online demo,showing below. I exported results, abs(cwt.ouput), and plot in Matlab with jet colormap. However the spectrogram was much difference.

what's more. I thought converting scale to frequency obeys the formular, Fb = dt*Fc/scale, Fc is the center frequency of morlet mother mavelet, equals to 0.8125Hz. The result seems not in this case.

I have tried to set my scales by using setCWTScaleVector , and reconstructed the signal. In fact there exists big variance between reconstructed signal and raw signal.

I am really confused and not familar with cwt. Could you be able to provide me with some guidance on doing time-frequency analysis with wavelib? I'd very much appreciate the help.

Best regards
Junying

@journeytosilius
Copy link

journeytosilius commented Oct 13, 2021

Hi @Junyinghouse I was looking at the demo and documentation and I could not find the frequency output. Can you share code on how are you getting the frequency out of the CWT result ?

As I understand, is this how you get frequency ?

        double Fb;
        double Fc = 0.8125;
        vector<double> frequency;

        for (int v = 0; v < N; ++v)
        {
            Fb = dt * Fc / wt->scale[v];
            frequency.push_back(Fb);
        }

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