I have looked around here, and i am sure this has been answered, but i don't understand it. The thing is, I have taken a introductory signal processing course, and we had to use Mathematica, and i had no previous experience in Mathematica, so this made a lot of things hard for me.
Now i need to understand how to visually present the spectral content of a sampled signal. So i try something simple,
sampls = Table[Sin[n*(2 \[Pi])/1000*4], {n, 0, 2000}];
where we can assume that the sampling period is 1/1000s and we have a sinus with a frequency of 4 Hz. This signal is sampled for 2 seconds, meaning we get 8 periods of the signal.
Now my naive attempt is to do this (as i saw something like this in some example somewhere):
ListLinePlot[Abs[FourierDCT[sampls]], PlotRange -> {{0, 100}, {0, 30}}]
Now i end up with this:
which i can't make any sense out of...
What does it mean?
My dream is to be able to plot frequency on the x-axis and amplitude on the y-axis, so that i could present the teacher with a nice narrow peak with height 1 right above 4 on such a plot.
My mathematical knowledge is rather weak, i'm sorry to say, so be gentle with me and explain as concrete as possible. This is not primarily a mathematics course.
FourierDST
- the discrete sine transform. But the peak's position still depends on the sample size. $\endgroup$Fourier
here. $\endgroup$FourierDCT
. (I roughly know that it's becauseSin[x]
is a odd function, but don't know how to explain it precisely. ) $\endgroup$