# Using the windowing Method

I'm trying to write a C program that can get the PSD of an recorded audio file, I'm using for the fftw3 library. I wrote a program that calculate the PSD so far only for sinus function, but the result is correct, my problem is that I have some trouble to use the windowing method on my data.

Let's say that the audio file has following properties :

fs = 44100;
length = 10sec;


So I got 441000samples, and I want to use windows, doesn't matter which one, with the size of 512, 25% overlapping, and shift my windows for the data. How could I know which value of the result is representing which frequency?

In Matlab it was easy here what I've done for example :

  [x,fs] = audioread('fileName.wav');
[xPSD,f] = pwelch(x,hanning(8192),4096,8192*4 ,fs);


Thanks for any help or explanation!

The $k$-th FFT bin will contain the complex amplitude for frequency $\frac{k}{512} \times 44100$.