In the following repo I plan to add code to manage .wav files in python.
I describe breifly the important (in my consideration) functions of each one the files.
--- inputs ---
chunk: represents the number of parts in which is divided the file.
formato: represnets the format of the audio.
channels: Number of channels to record (Inn one of them you could record the noise for example).
Rate: Number of data that it takes per second per second. (so, t_s = 1/Rate)
wavenamei: wavefilei for which you want to apply the function.
fi,ff: In terval of frequencies in which you wan to see your graph.
norm: choose if you wnat a normalize spectrum of frequencies (do norm='yes' if that is the case).
secondpertone: seconds that you want a given tone to long.
littletone: minimum tone that you want.
maxtone: maximum value that a tone could take.
steptone: difference that you want between two tones.
--- outputs ---
dt: separation between two consecutive times in the array time.
time: array of all the time of the record.
Data: Values of the signal in the respective time.
Dataft: Values of the amplitues for a given frequency.
freq: Correspondent array of frequencies for Dataft.
This funtions plot the transform for the wavename1 file between fi and ff. The normalization depends of you.
This is to record directly from the computer.
Tis is to generate a sequence of tones with a given step.
Get data, t and dt from the wav file.
Get freq and Dataft.
Apply the fourier transform with a simple implementation (It is not the FFT).
Plot freq vs Dataft in the interval fi and ff.
Record somehing and then apply and show the transform.
Plot the fourier transform for a given wav file.
Plot the fourier transform of a file and a zoom for the maximum frequency found. note: (Change only to search in positive frequecies).
Plot the fourier transform of a file and a zoom for the maximum frequencies found for both files in a same figure. note: (Change only to search in positive frequecies).
Apply the short fourier transform for a given file in intervals separated approximately time (the nearer value multiple to Record_seconds is the one taken) seconds.