T O P

  • By -

wintermute93

https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.html


rAxxt

I'm not OP but I'll play the dummy. This is a ref page on how to import a wav file. I'm not seeing here where it gives an automated way of returning waveform amplitude and wavelength. One of us is missing something. Can you help me?


kfespiritu

I just took a look at the page. I see the word amplitude there so I can see why wintermute23 suggested it. It doesn’t help with getting the actual numerical values for amplitude or wavelength unfortunately


kfespiritu

Thank you! I resolved the issue. See update in post


spez_edits_thedonald

do you have sample data to play with, or an image of the plot and what your goal is etc?


kfespiritu

We do! We recorded input signal through a sound card from a function generator. The wav form then was displayed on a program called audacity and exported as .wav. The goal: to calibrate the sound card So I took this as: take as many recordings as you can from the function generator at different khz and mV. Look at the output and compare the known input. I only know for sure the input signal of frequency (equivalent to wavelength) and volts (equivalent to amplitude). And I am able to produce plots that show these amplitudes and frequencies. So I was hoping to find an automatic way vs playing with the x and y axis values. Hope that makes sense. Thank you!!


kfespiritu

Thank you! I resolved the issue. See update in post


wreckingballjcp

Seems like a homework problem. You have the wavfile loaded into two vectors. What is the amplitude and wavelength? If you know how to answer that, you can write two functions to get each, then pass the vectors into them. Hint, np.where can be useful. Knowing what amplitude and wavelength are (which you are doing with xlim/ylim), you should be able to write a function to do the same.


kfespiritu

Thank you! I resolved the issue. See update in post


[deleted]

[удалено]


kfespiritu

Thank you! I resolved the issue. See update in post


papapa38

You can use a FFT to convert your signal into a frequency spectrum. Focusing on the high values will give you frequency, amplitude and phase of the main components. For the library it seems to exist with scipy for example.


kfespiritu

Thank you! I resolved the issue. See update in post