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

how to use thdcalculator.py? #24

Open
peterpain1216 opened this issue Dec 27, 2022 · 3 comments
Open

how to use thdcalculator.py? #24

peterpain1216 opened this issue Dec 27, 2022 · 3 comments

Comments

@peterpain1216
Copy link

when i entered
:python3 thdcalculator.py mytestfile.wav, nothing happened.

then i use:
python3 thd_analyzer_launcher.py mytestfile.wav, i got this error:

Exception:
name 'analyze_channels' is not defined

sorry for being a noob, how to use the scripts properly? thanks

@peterpain1216
Copy link
Author

python3 wave_analyzer_launcher.py mytestfile.wav

this script works fine for me.

@endolith
Copy link
Owner

Yeah it appears to not be finished, sorry. I'm not sure why I pushed it that way. For now you can load the WAV into an array and process it with THDN() https://github.com/endolith/waveform_analysis/blob/master/waveform_analysis/thd.py#L44 and it will return the ratio.

@endolith
Copy link
Owner

endolith commented Dec 28, 2022

Or just use the old version: https://gist.github.com/endolith/246092

That works as you would expect:

λ python thdncalculator.py  "THD 75 harmonic -60 dB.wav"
Analyzing "THD 75 harmonic -60 dB.wav"...
Frequency: 40.000000 Hz
THD+N:     0.1109% or -59.1 dB

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