python-3.xaudiocompressionmp3continuous-fourier

Converting wav to mp3 from python


I'm not sure the best way to ask this question, but here goes.

I created my own way to do a type of Fourier transform, and I would like to see if this gives me better compression than the standard methods of FFT. Currently, I am reading in a wav file, doing the Fourier transform using my method (it's not an FFT or discrete), and reproducing the wav data. I then use the ffmep command-line tool to convert my wav file to mp3.

My question is, does this process make my Fourier transform redundant?

If so, how can I produce an mp3 file, given my Fourier series?

What I am trying to achieve: I have a fourier transform algorithm that I think is better at compressing and the standard FFT, and I'd like to test this hypothesis on sound compression. What is the best way to do this?


Solution

  • I would forget about mp3 ... your compression technique replaces mp3 ... instead I would focus on raw audio in PCM format here

    their process

    PCM  ->    conversion to mp3    ->    mp3 file     -> decoding to PCM -> PCM
    

    your process

    PCM  ->  your compression trick -> SpentDeath file ->  decoding to PCM -> PCM
    

    just use same raw audio PCM as input into both of the above two process flows ... one comparison would be file size of mp3 compared to your compressed file ... second comparison being quality of output final PCM

    I hear what you are saying regarding its not a FFT however keep in mind if it was a FFT the degree to which you have greater frequency granularity (smaller difference between each frequency together with its magnitude) the greater number of needed audio samples ... meaning greater frequency measurement accuracy in frequency space demands a longer window of audio samples in time domain ... which is fine for aperiodic signals (when audio is only a constant tone not a song) ... however for constantly changing audio like in a song which is aperiodic there is no such thing as meaningful wide windows of audio samples since as you widen your sampling window you are including ever more disparate curves from an ever changing audio signal and so the resultant frequency magnitudes will be derived from an averaging out of all frequencies encountered throughout the sampling window and so the price you pay is a loss of time domain accuracy once the FFT returns your audio signal back to PCM using the inverse Fourier Transform