Skip to main content
Post Closed as "Duplicate" by Jason B., CommunityBot, Öskå, MarcoB, Simon Woods
added 31 characters in body
Source Link

I asked a question some days ago and it was very well answer. However, I have a new one. I don't understand why the phase of the discrete fourier transformation is not correct. It has the correct answer, but it also has other points that are not correct.

Here, the correct analytical answer:

FourierTransform[Exp[-t]*UnitStep[t], t, w, FourierParameters -> {1, -1}] Plot[Abs[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] Plot[Arg[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] 

enter image description here

Here, the numerical results I obtained:

signal[i_] := Exp[-(i*samplingPeriode)]*UnitStep[(i*samplingPeriode)] initialTime = -10; finalTime = 10; signalDuration = finalTime - initialTime; bandwidth = 50; nyquistRate = 2*bandwidth; nyquistSamplingPeriode = 1/nyquistRate; samplingFrequency = 20*nyquistRate;2*nyquistRate; samplingPeriode = 1/samplingFrequency; numberOfSamples = signalDuration/samplingPeriode; yValuesSampledSignal = Table[signal[i], {i, initialTime/samplingPeriode, finalTime/samplingPeriode,samplingPeriode}]; xValuesSampledSignal = Table[i*samplingPeriode, {i, initialTime/samplingPeriode, finalTime/samplingPeriode,samplingPeriode}]; sampledSignal = Partition[Riffle[xValuesSampledSignal, yValuesSampledSignal], 2]; yValuesDiscreteFourierTransform = samplingPeriode* Fourier[yValuesSampledSignal, FourierParameters -> {1, -1}]; rotatedYValuesDiscreteFourierTransform = RotateRight[yValuesDiscreteFourierTransform, numberOfSamples/2]; xValuesDiscreteFourierTransform = Table[i*(1/signalDuration), {i, -(numberOfSamples/2), numberOfSamples/2}]; discreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, yValuesDiscreteFourierTransform], 2]; absYValuesDiscreteFourierTransform = Abs[rotatedYValuesDiscreteFourierTransform]; absDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, absYValuesDiscreteFourierTransform], 2]; argYValuesDiscreteFourierTransform = Arg[rotatedYValuesDiscreteFourierTransform]; argDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, argYValuesDiscreteFourierTransform], 2]; yValuesRecontructedSignal = (1/samplingPeriode)* InverseFourier[yValuesDiscreteFourierTransform, FourierParameters -> {1, -1}]; xValuesRecontructedSignal = xValuesSampledSignal; reconstructedSignal = Partition[ Riffle[xValuesRecontructedSignal, yValuesRecontructedSignal], 2]; ListLinePlot[sampledSignal, PlotRange -> All] ListPlot[Take[ absDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListPlot[Take[ argDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListLinePlot[reconstructedSignal, PlotRange -> All] 

enter image description here

I asked a question some days ago and it was very well answer. However, I have a new one. I don't understand why the phase of the discrete fourier transformation is not correct. It has the correct answer, but it also has other points that are not correct.

Here, the correct analytical answer:

FourierTransform[Exp[-t]*UnitStep[t], t, w, FourierParameters -> {1, -1}] Plot[Abs[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] Plot[Arg[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] 

enter image description here

Here, the numerical results I obtained:

signal[i_] := Exp[-(i*samplingPeriode)]*UnitStep[(i*samplingPeriode)] initialTime = -10; finalTime = 10; signalDuration = finalTime - initialTime; bandwidth = 50; nyquistRate = 2*bandwidth; nyquistSamplingPeriode = 1/nyquistRate; samplingFrequency = 20*nyquistRate; samplingPeriode = 1/samplingFrequency; numberOfSamples = signalDuration/samplingPeriode; yValuesSampledSignal = Table[signal[i], {i, initialTime/samplingPeriode, finalTime/samplingPeriode}]; xValuesSampledSignal = Table[i*samplingPeriode, {i, initialTime/samplingPeriode, finalTime/samplingPeriode}]; sampledSignal = Partition[Riffle[xValuesSampledSignal, yValuesSampledSignal], 2]; yValuesDiscreteFourierTransform = samplingPeriode* Fourier[yValuesSampledSignal, FourierParameters -> {1, -1}]; rotatedYValuesDiscreteFourierTransform = RotateRight[yValuesDiscreteFourierTransform, numberOfSamples/2]; xValuesDiscreteFourierTransform = Table[i*(1/signalDuration), {i, -(numberOfSamples/2), numberOfSamples/2}]; discreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, yValuesDiscreteFourierTransform], 2]; absYValuesDiscreteFourierTransform = Abs[rotatedYValuesDiscreteFourierTransform]; absDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, absYValuesDiscreteFourierTransform], 2]; argYValuesDiscreteFourierTransform = Arg[rotatedYValuesDiscreteFourierTransform]; argDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, argYValuesDiscreteFourierTransform], 2]; yValuesRecontructedSignal = (1/samplingPeriode)* InverseFourier[yValuesDiscreteFourierTransform, FourierParameters -> {1, -1}]; xValuesRecontructedSignal = xValuesSampledSignal; reconstructedSignal = Partition[ Riffle[xValuesRecontructedSignal, yValuesRecontructedSignal], 2]; ListLinePlot[sampledSignal, PlotRange -> All] ListPlot[Take[ absDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListPlot[Take[ argDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListLinePlot[reconstructedSignal, PlotRange -> All] 

enter image description here

I asked a question some days ago and it was very well answer. However, I have a new one. I don't understand why the phase of the discrete fourier transformation is not correct. It has the correct answer, but it also has other points that are not correct.

Here, the correct analytical answer:

FourierTransform[Exp[-t]*UnitStep[t], t, w, FourierParameters -> {1, -1}] Plot[Abs[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] Plot[Arg[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] 

enter image description here

Here, the numerical results I obtained:

signal[i_] := Exp[-(i*samplingPeriode)]*UnitStep[(i*samplingPeriode)] initialTime = -10; finalTime = 10; signalDuration = finalTime - initialTime; bandwidth = 50; nyquistRate = 2*bandwidth; nyquistSamplingPeriode = 1/nyquistRate; samplingFrequency = 2*nyquistRate; samplingPeriode = 1/samplingFrequency; numberOfSamples = signalDuration/samplingPeriode; yValuesSampledSignal = Table[signal[i], {i, initialTime/samplingPeriode, finalTime/samplingPeriode,samplingPeriode}]; xValuesSampledSignal = Table[i*samplingPeriode, {i, initialTime/samplingPeriode, finalTime/samplingPeriode,samplingPeriode}]; sampledSignal = Partition[Riffle[xValuesSampledSignal, yValuesSampledSignal], 2]; yValuesDiscreteFourierTransform = samplingPeriode* Fourier[yValuesSampledSignal, FourierParameters -> {1, -1}]; rotatedYValuesDiscreteFourierTransform = RotateRight[yValuesDiscreteFourierTransform, numberOfSamples/2]; xValuesDiscreteFourierTransform = Table[i*(1/signalDuration), {i, -(numberOfSamples/2), numberOfSamples/2}]; discreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, yValuesDiscreteFourierTransform], 2]; absYValuesDiscreteFourierTransform = Abs[rotatedYValuesDiscreteFourierTransform]; absDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, absYValuesDiscreteFourierTransform], 2]; argYValuesDiscreteFourierTransform = Arg[rotatedYValuesDiscreteFourierTransform]; argDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, argYValuesDiscreteFourierTransform], 2]; yValuesRecontructedSignal = (1/samplingPeriode)* InverseFourier[yValuesDiscreteFourierTransform, FourierParameters -> {1, -1}]; xValuesRecontructedSignal = xValuesSampledSignal; reconstructedSignal = Partition[ Riffle[xValuesRecontructedSignal, yValuesRecontructedSignal], 2]; ListLinePlot[sampledSignal, PlotRange -> All] ListPlot[Take[ absDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListPlot[Take[ argDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListLinePlot[reconstructedSignal, PlotRange -> All] 

enter image description here

Source Link

Phase in discrete Fourier transformation

I asked a question some days ago and it was very well answer. However, I have a new one. I don't understand why the phase of the discrete fourier transformation is not correct. It has the correct answer, but it also has other points that are not correct.

Here, the correct analytical answer:

FourierTransform[Exp[-t]*UnitStep[t], t, w, FourierParameters -> {1, -1}] Plot[Abs[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] Plot[Arg[-(I/(-I + 2*Pi*f))], {f, -5, 5}, PlotRange -> All] 

enter image description here

Here, the numerical results I obtained:

signal[i_] := Exp[-(i*samplingPeriode)]*UnitStep[(i*samplingPeriode)] initialTime = -10; finalTime = 10; signalDuration = finalTime - initialTime; bandwidth = 50; nyquistRate = 2*bandwidth; nyquistSamplingPeriode = 1/nyquistRate; samplingFrequency = 20*nyquistRate; samplingPeriode = 1/samplingFrequency; numberOfSamples = signalDuration/samplingPeriode; yValuesSampledSignal = Table[signal[i], {i, initialTime/samplingPeriode, finalTime/samplingPeriode}]; xValuesSampledSignal = Table[i*samplingPeriode, {i, initialTime/samplingPeriode, finalTime/samplingPeriode}]; sampledSignal = Partition[Riffle[xValuesSampledSignal, yValuesSampledSignal], 2]; yValuesDiscreteFourierTransform = samplingPeriode* Fourier[yValuesSampledSignal, FourierParameters -> {1, -1}]; rotatedYValuesDiscreteFourierTransform = RotateRight[yValuesDiscreteFourierTransform, numberOfSamples/2]; xValuesDiscreteFourierTransform = Table[i*(1/signalDuration), {i, -(numberOfSamples/2), numberOfSamples/2}]; discreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, yValuesDiscreteFourierTransform], 2]; absYValuesDiscreteFourierTransform = Abs[rotatedYValuesDiscreteFourierTransform]; absDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, absYValuesDiscreteFourierTransform], 2]; argYValuesDiscreteFourierTransform = Arg[rotatedYValuesDiscreteFourierTransform]; argDiscreteFourierTransform = Partition[ Riffle[xValuesDiscreteFourierTransform, argYValuesDiscreteFourierTransform], 2]; yValuesRecontructedSignal = (1/samplingPeriode)* InverseFourier[yValuesDiscreteFourierTransform, FourierParameters -> {1, -1}]; xValuesRecontructedSignal = xValuesSampledSignal; reconstructedSignal = Partition[ Riffle[xValuesRecontructedSignal, yValuesRecontructedSignal], 2]; ListLinePlot[sampledSignal, PlotRange -> All] ListPlot[Take[ absDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListPlot[Take[ argDiscreteFourierTransform, {numberOfSamples/2 - 100, numberOfSamples/2 + 100}], Filling -> Axis, PlotRange -> All] ListLinePlot[reconstructedSignal, PlotRange -> All] 

enter image description here