# Fourier transform of sampled data

I have got some impulse response data that I would like to transform via Fourier to get the amplitude-frequency characteristics of the performing loudspeaker. The final goal is to show (e.g. via ListDensityPlot) how the calculated amplitude-frequency characteristics is dependant on the window I choose to transform (truncation of low frequencies). The issue I have is to get Fourier to behave like desired - I am unable to reproduce the frequency response that I got out of another 3rd part software. The issue:

There is no SampleRate option for Fourier (and I got a sampling frequency of 48kHz)

The following example illustrates the issues:

data = Table[Sin[x], {x, 0, 100}];

ListPlot[
Take[10*Log10[(Abs@Fourier[data, FourierParameters -> {1, -1}])^2],
Floor@(Length[Fourier[data, FourierParameters -> {1, -1}]]/2)],
Joined -> True, PlotRange -> Full]


Periodogram[data, FourierParameters -> {1, -1}, SampleRate -> 1,
PlotRange -> Full, ScalingFunctions -> "dB"]


• You are not using the same processing methods. Try ScalingFunctions -> "Absolute", and compare against a ListPlot of the Fourier transform, not ListLogPlot. However, as posted, the two plots are identical except for their scale. Commented Apr 30, 2013 at 16:04
• Figured that as well just this instant. The only issue is still to incorporate the sampling frequency when using Fourier. I will change the question accordingly. Commented Apr 30, 2013 at 16:08
• ListLogPlot applies Log10 to the data and makes y-axis ticks in logarithmic style. But dB aren't just Log10 it's 10*Log10. And also SampleRate needs to be changed to number of data points, 100 in your case. Commented Apr 30, 2013 at 16:16
• The issue is that my actual data has a sample frequency of 48000Hz and that I can't find any option to tell Fourier that. Commented Apr 30, 2013 at 16:29

samplerate = 48000;
time = Length[data]/samplerate;
nyq = Floor[Length[data]/2];
ListPlot[
Take[10*Log10[(Abs@Fourier[data, FourierParameters -> {1, -1}])^2], nyq],
Joined -> True, PlotRange -> Full,
DataRange -> {0, (nyq - 1)/time}]


Compare with periodigram with given sample rate of 48 kHz:

Periodogram[data, FourierParameters -> {1, -1}, SampleRate -> 48000,
PlotRange -> Full, ScalingFunctions -> "dB"]