Tag Info

New answers tagged

5

We can transform the image into polar coordinates, after which averaging across angles is trivial. polarTransform[img_, rmax_] := With[{size = Max@ImageDimensions[img]}, ImageTransformation[img, Function[{r, t}, {r Cos[t], r Sin[t]}] @@ # &, {rmax, 2 Pi rmax}, DataRange -> {{-size/2, size/2}, {-size/2, size/2}}, PlotRange -> {{0, ...


4

How about using nesting ImageRotate: t = NestList[ImageRotate[#, 5 Degree, Full] &, img, 71]; ImageData /@ t; out = Total[%] // Image // ImageAdjust Extracting a line looks similar to yours idata = ImageData[out]; ListPlot[idata[[All, 512]], PlotRange -> {{512, 652}, {0.4, 1}}, Frame -> True]


3

Jenson is correct in his comment above ("Use FourierDST"). The reason is that your waveform is a sine wave - that is, it is zero at the ends of your time interval. All cosine harmonics are 1 at n=0, and for the waveform shown 1 at the end of the interval. Therefore, approximating a sine wave with a sum of cosines is not a trivial exercise, and you get a ...


2

I'm not big on Mathematica, but... your plot looks familiar. The double-spike in the middle happens when your sinewave frequency isn't some nice multiple of the sample rate. As a result, the "energy" gets "smeared" across the frequency spectrum. When doing a Fourier Transform, this also happens when sampling signals that suddenly "start" and "stop". The ...


6

I like @Vitaliy's answer, but here's another approach using Fourierinstead of Periodogram. time = 2; tinc = 0.001; sampls = Table[Sin[n*(2 Pi) 4], {n, 0, 2, tinc}]; nyquist = 1/(2 tinc) len = Length@sampls; ListLinePlot[Sqrt[4/len] Abs@Fourier[sampls], PlotRange -> {{0, 10}, All}, DataRange -> {0, (len - 1)/time}] Briefly, I construct a sample ...


18

This is how I would do this. Define frequencies and sampling rate precisely. Then use Periodogram because it takes SampleRate as an option and rescales frequency axis automatically. Read up Docs on Periodogram - see examples there. data = Table[{t, Sin[2 Pi 697 t] + Sin[2 Pi 1209 t]}, {t, 0., 0.1, 1/8000.}]; ListLinePlot[data, AspectRatio -> 1/4, ...



Top 50 recent answers are included