1

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?

lee
  • 740
  • 2
  • 11
  • 24

1 Answers1

1

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

Scott Stensland
  • 26,870
  • 12
  • 93
  • 104
  • That was very helpful. I have one more question, how can I compare the loss level between mp3 and the original source? Should I just look at the original PCM file, and the PCM file generated from mp3 conversion, and do a diff? With my method, the loss is known ahead of time, it's a parameter you feed in as a loss tolerance. – lee Jul 22 '18 at 19:49
  • 1
    there must be tools out there to perform comparison between a pair of PCM files ... for starters I lean towards using Audacity to perform eyeball comparisons ... it has a nice visualization of the audio curve ... it will import a raw audio PCM file .. of course just doing a FFT on each of the PCM files again will get your into the ball park .. sonicvisualiser.org can do FFT ... great thing about audio is its a time series so comparisons using python should be around .. https://docs.scipy.org/doc/scipy/reference/signal.html might have something or else google : python numpy compare two arrays – Scott Stensland Jul 23 '18 at 01:11