# Relation between samplingrate and frequency

I am working on Fourier Transformation, and applying this for recognizing an audioclip.

I have a 9 second long audio clip of a guitar strumming an A-Minor. The audioclip has a sampling rate of 44100 Amplitudes per second, and a bitdepth of 16 bits.

I do a fourier Transform of the audiofile(green graph), and get a spectrum where the samples are the x-axis. I want to have frequencies along the x-axis, for being able to recognize the pitches, so I again can recognize the chord that is being played.

Instead I get samples. How can I convert this to frequency?

Here is a photo of my spectrums, one of them zoomed in on the samples from 0 to 10 000. You're looking at a full spectrum as displayed on the second figure where the second half is a flipped replica of the first half. You're doing a DFT to get your spectrum; by definition the frequency spacing between each of your DFT samples will depend on the length $N$ of the Discrete Fourier Transform (DFT). For a length-$N$ DFT the frequency $f_k$ in $\rm Hz$ corresponding to DFT sample $k$ is given by $$f_k = \frac{F_s}{N}k, \quad k=0, 1, \ldots, N-1.$$ You have samples on $x$-axis as $k$, you have $F_s = 44100\ \rm Hz$, then check the $N$ (i.e. $NFFT$) used in your spectrum computation and you have your frequencies in $\rm Hz$.
you have 9 $\times$ 44100 = 396900 samples. I assume you did a single FFT and you should take the first , 198450 complex points for your plot after taking the magnitude square. The last 198450 points out of the FFT are a mirror image of the first 198450 points so you can neglect them. The first kept point corresponds to $f=0$ and the last kept point to $f=22050$ Hz. which makes each bin .1111 wide
• Each bin won't be necessarily $22050/(396900/2) = 0.1111\ \rm Hz$ unless OP is using the full length, which he does not mention. – Gilles Nov 13 '17 at 0:00