Welcome, Guest. Please login or register.

Author Topic: Fourier analysis (of a sound)  (Read 2302 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Fourier analysis (of a sound)
« Reply #14 from previous page: October 06, 2007, 05:34:37 PM »
Quote
Is that another way of saying that even if the original complex signal is aperiodic, the resultant sine waves will be periodic?


An elegant summary, sir!

Quote
Understood. But I'm not talking about using an infinitely long signal - just a short one, e.g. somebody saying "hello".


Of course. However, the reason I mentioned that was to tie in with things like live stream encoding, which are essentially indefinately long. You have no choice but to encode such things in discrete chunks.


Quote
Ahhh I think I understand what you're saying. A FT on a whole 10 second signal may create 10 million pure tones, whereas a FT on each of the 10 one-second chunks would create 10 much smaller spectra, maybe of 1000 pure tones each, because each chunk is less complex (by virtue of the fact that it is shorter). Is that kind of what you mean?


Exactly that. To give you an idea, MP3 typically encodes chunks of source audio that are 576 samples long. If there is a transient (a sudden, sharp signal) in the source data, it uses a chunk of 192 samples. These slices are but only a few milliseconds long at 44kHz.

In contrast, the machines that I used to use to get NMR spectra for the compounds I was preparing would FFT a signal that was several seconds long, repeating the process several times and averaging the results until a sharp, well defined spectrum was obtained. These machines had horsepower could encode normal mp3 many times realtime, but would take several minutes to produce the FFT for the NMR spectrum.
int p; // A
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Fourier analysis (of a sound)
« Reply #15 on: October 06, 2007, 06:52:34 PM »
So what are the implications for some half-baked home experiment? ;-) I really want to try this with a (very short) speech sound. Is that possible with software on a home computer? I don't care if I have to leave it running for a few days.

Thanks, BTW, for taking the time to go in to so much detail in your replies.


--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Fourier analysis (of a sound)
« Reply #16 on: October 07, 2007, 05:15:00 AM »
Quote
So what are the implications for some half-baked home experiment?


There's only one way to find out :-D It's almost certainly doable.

You can find a lot of example FFT code in C/C++ out there. Depending on the implementation of the algorithm you might have to pad your sample to the nearest power of two length (in samples).

I have some pretty fast code for performing FFT on audio (unless the backup CD rotted) but unfortunately it's written in assembler for a Zilog DSP...
int p; // A
 

Offline nBit7

  • Full Member
  • ***
  • Join Date: Jul 2007
  • Posts: 143
    • Show only replies by nBit7
Re: Fourier analysis (of a sound)
« Reply #17 on: October 07, 2007, 05:29:05 AM »
You may find a spectrogram display to be of more interest when looking at speech.  This is basically an FFT vs time display. Normally the frequency spectrum is shown in the y-axis but the amplitute is shown by color.  The x-axis is used for time.

An example here (I havn't looked at the program it self):
http://www.visualizationsoftware.com/gram.html
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Fourier analysis (of a sound)
« Reply #18 on: October 07, 2007, 07:00:54 AM »
Thanks Karlos, I'll give it a go. I don't really have the time to write my own software from code examples, but I have find this software which claims to be able to transform between time and frequency domains. My Parallels Windows installation is running a macro to remove a watermark from an 800 page PDF at the moment, so I'll have to wait until it's done before I can try it out.

@nbit7
Thanks for the link. I will try that too.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Boot_WB

  • Hero Member
  • *****
  • Join Date: Feb 2005
  • Posts: 1326
    • Show only replies by Boot_WB
    • http://www.hullchimneyservices.co.uk
Re: Fourier analysis (of a sound)
« Reply #19 on: October 07, 2007, 12:17:48 PM »
You could always try aminet and set your Amiga to work :-)

Although it may take a little longer to complete ;-)
Mac Mini G4 (1.5GHz, 64MB VRam, 1GB Ram): MorphOS 3.6
Powerbook 5.8 (15", 1.67GHz, 128MB VRam, 1GB Ram): MorphOS 3.8.

Windows-free since 2011-2014 (Damn you Netflix!)
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Fourier analysis (of a sound)
« Reply #20 on: October 07, 2007, 12:24:28 PM »
Why didn't I think of that??!! It would be much more fun to do it on an Amiga, and would make me feel much more smug when I show my results to my lecturer ;-) Thanks Boot_WB!

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline sTix

  • Full Member
  • ***
  • Join Date: Sep 2002
  • Posts: 137
    • Show only replies by sTix
    • http://pegasos.dyndns.biz
Re: Fourier analysis (of a sound)
« Reply #21 on: October 12, 2007, 06:15:59 PM »
I think this is what your looking for:  praat