# Is my calculation of the power spectrum correct?

• I
• arcTomato
In summary, Charles Link explains that the power spectrum is the square of the absolute value of the Fourier transform of the light curve and the window function. Convolution-integration is then performed to get the power spectrum.Charles Link has two questions: first, is it correct to perform the calculations in a different order, and second, can the spectrum be approximated by a simple function?
arcTomato
Hello PF.

I am thinking about the power spectrum when observing X-rays.
We are trying to obtain the power spectrum by applying a window function ##w(t)## to a light curve ##a(t)## and then Fourier transforming it.

I have seen the following definition of power spectrum ##P(\omega)##. Suppose the Fourier transformation of light curve is ##A## and the Fourier transformation window function is ##W##,
$$P(\omega)= |A(\omega)|^{2} *|W(\omega)|^{2}$$

In other words, you are squaring the absolute value of each and then doing convolution integration.

But my actual calculations are as follows.

The Fourier transformation of light curve and window function is
$$\int_{-\infty}^{\infty} a(t)w(t) e^{i \omega t} d t \\ = A(\omega) * W(\omega) .$$
so Power spectrum is
$$P(\omega)= | A(\omega) * W(\omega) | ^2.$$
In my own calculations, I convolution-integrate each and then square the absolute value. (The order of the calculations is different.)

I have two questions.
First, I think these are very different, but am I doing my calculations wrong?
Second, under certain conditions, can these be approximated?

Thank you.

It sounds like you are attempting to determine the spectrum of the x-rays by mechanically modulating the power spectrum. That simply will not work. Even for visible light, it is necessary to have some sort of dispersion, e.g. by using a prism or a diffraction grating, to get the curve for the spectral intensity.

arcTomato
I'm sorry for my poor English @Charles Link .
I can observe x-rays with an x-ray observer and get the light curve itself as data.
The goal is to Fourier transform the light curve, or time series data, and get the power spectrum.

My question was about the defining equation for this.

@Charles Link, I don't think this is an optical spectrum measurement. I think the OP is interested in the low frequency time-dependence of the x-ray power measured by a detector. You read signal off the detector vs time and take an FFT, so the results are bandlimited by the detector's integration time. These features will not be resolved by any grating known to me.

I believe the two expressions for power spectrum are identical, because the norm of a product is the product of norms for complex numbers (and this, I believe, applies to convolution by extension). I'll double check this when I'm not stuck on a bus, later this evening

@Twigg
Thank you.

I see.
If you could give me a detailed explanation, that would be very helpful.

Sorry for the delay. I'm going to need more time to think on it, as it wasn't as simple as I thought.

As you say, $$P(\omega) = |A(\omega) * W(\omega)|^2 = |\int_{-\infty}^{\infty} d\omega' A(\omega - \omega') W(\omega')|^2$$
Now use the property ##|ab| = |a||b|## to get $$P(\omega) = \left( \int_{-\infty}^{\infty} d\omega' |A(\omega - \omega')| |W(\omega')| \right)^2$$ (Edit: this step is wrong!)
This was the step I was referring to in post #4.
I'm still trying to figure out how to connect this to ##|A(\omega)|^2 * |W(\omega)|^2##.

Last edited:
arcTomato
@Twigg I am grateful for your thoughts on the issues I am facing.

I am still aware that it is generally defined as the former (##P(\omega)=|A(\omega)|^{2} *|W(\omega)|^{2}##).

I am thinking about under what circumstances the two coincide.

First thing is that I messed up in my last post. $$|\int_{-\infty}^{\infty} d\omega' A(\omega - \omega') W(\omega') | \neq \int_{-\infty}^{\infty} d\omega' |A(\omega - \omega')| |W(\omega')|$$

The second thing is that I no longer think the two statements ##P(\omega) = |A(\omega)|^2 * |W(\omega)|^2## and ##P(\omega) = |A(\omega) * W(\omega)|^2## are equivalent. Sorry for the confusion.

The reason I think so is that there is a unit mismatch. ##|A(\omega) * W(\omega)|^2## has units of ##\mathrm{Hz}^{-2}##, while ##|A(\omega)|^2 * |W(\omega)|^2## has units of ##\mathrm{Hz}^{-3}##.

I have a hunch that the expression ##P(\omega) = |A(\omega)|^2 * |W(\omega)|^2## is a generalized statement of Welch's method (see here for the nuts and bolts, or check out the chapter on spectral density estimation in Numerical Recipes in C - section 13.7 page 681). I couldn't tell you exactly why the Welch expression is a "better" estimate than your periodogram-like expression.

Unfortunately, I'm coming up on my qualifying exam soon and I might not be able to keep up with this thread. I'll reply as I can. If you find out anything, let us know!

arcTomato
@Twigg
Thank you.

I didn't realize that the units were different. I will check it myself.

It's going to take me a while to figure it out, but your advice has been very helpful.
If I get any more tips myself, I'll post them in this thread.
I wish you all the best with your exams!

arcTomato said:
The Fourier transformation of light curve and window function is
$$\int_{-\infty}^{\infty} a(t)w(t) e^{i \omega t} d t \\$$
I think the term in your Fourier transform should be ## exp(-i\omega t) ##.

@rude man Thank you.

My understanding is that the sign of exp in the Fourier transform must be opposite to the sign on the shoulder in the forward and inverse transforms, but it depends on the definition of which should have which sign.

@Twigg

P.S.
I was able to understand it somehow.
First of all, as for units, they should be the same for both. (I figured it out by thinking that each Fourier transform, A and W, has the same units as the units before the Fourier transform.)
Also, I think the ##|A(\omega) * W(\omega)|^{2}## and ## |A(\omega)|^{2} *|W(\omega)|^{2} ## have the same meaning only when A is a periodic function like sinusoid.

I have not yet figured out what happens when it is a continuous function.

The reason I think the units aren't the same is because the convolution itself adds units of Hz, since ##(f * g)(\omega) = \int f(\omega') g(\omega - \omega') d\omega'##. You have to keep in mind that ##d\omega'## has units of Hz (or rads/s if you want to be extra specific). ##|A|^2 * |W|^2## has one convolution in it, while ##|A * W|^2## has two convolutions in it (two factors of ##d\omega'##).

arcTomato said:
I have seen the following definition of power spectrum P(ω).
By the way, where did you see this definition? There might be some clues there.

The first “definition” of P is wrong—it doesn’t follow from Fourier theory. Your second definition is correct.

hutchphd
rude man said:
I think the term in your Fourier transform should be ## exp(-i\omega t) ##.
That's a question of conventions. In theoretical physics (at least in people using quantum (field) theory a lot) usually you have
$$f(t)=\int_{\mathbb{R}} \mathrm{d} \omega \frac{1}{2 \pi} \tilde{f}(\omega) \exp(-\mathrm{i} \omega t)$$
and accordingly the inverse transformation
$$\tilde{f}(\omega)=\int_{\mathbb{R}} \mathrm{d} t f(t) \exp(+\mathrm{i} \omega t).$$
It's also convention, how you normalize your "mode function". Sometimes one also puts an ##1/\sqrt{2\pi}## in both integrals.

marcusl said:
The first “definition” of P is wrong—it doesn’t follow from Fourier theory. Your second definition is correct.
I'm not convinced. I believe what you have in mind is the energy spectral density (aka periodogram). This is not the same as the power spectral density (PSD), but frequently the periodogram is used as an estimate of the PSD.

The energy spectral density / periodogram of a function ##f(t)## is given by ##|f(\omega)|^2##. Is that what you were thinking of?

The power spectral density is defined by $$\lim_{T \rightarrow \infty} \frac{1}{T} |f(\omega) * w_T(\omega)|^2$$ where ##w_T(t)## is a window function with duration T. Since you can't actually evaluate this limit for a real set of timeseries data, you usually use estimates for the PSD. One such estimate is the periodogram itself, another is Welch's method which I felt was similar to the expression ##|A(\omega)|^2 * |w(\omega)|^2##. That's why I'm not convinced it's wrong, because it could just be some form of estimate.

Also, the power spectrum recorded by a spectrum analyzer is usually a periodogram, but it's worth checking in the manual for a given model.

vanhees71
If the OP is working with continuous and infinite functions, then your definition in the limit is above is correct.
As I read it, however, the OP wants to compute a power spectrum numerically. A common numerical estimate of the power spectrum of a sequence x(n) is the periodogram
$$I(\omega)=\frac{1}{N}\left\vert\sum_{n=0}^{N-1}x(n)e^{-i\omega n}\right\vert^2$$
In either case, I have not seen $|A(\omega)|^2 * |w(\omega)|^2$.

vanhees71 and Twigg

## 1. What is the definition of power spectrum?

The power spectrum is a mathematical representation that describes the distribution of power or energy over a range of frequencies in a signal or system. It is a commonly used tool in signal processing and is often used to analyze the frequency components of a signal.

## 2. How is power spectrum calculated?

The power spectrum is typically calculated by taking the Fourier transform of a signal or system, squaring the magnitude of the resulting complex numbers, and then plotting the squared magnitudes against frequency. This process is also known as spectral analysis.

## 3. What information can be obtained from a power spectrum?

A power spectrum can provide information about the dominant frequencies present in a signal or system, as well as the relative strength or amplitude of each frequency component. It can also be used to identify any periodicity or patterns in the signal.

## 4. What is the difference between power spectrum and amplitude spectrum?

The power spectrum represents the distribution of power or energy over a range of frequencies, while the amplitude spectrum represents the amplitude or strength of each individual frequency component. In other words, the power spectrum shows the overall energy content of a signal, while the amplitude spectrum shows the strength of each frequency component.

## 5. How is power spectrum used in different fields of science?

The power spectrum is used in a variety of fields, including astronomy, physics, engineering, and biology. In astronomy, it is used to study the frequency components of celestial objects and detect any periodic signals. In physics, it is used to analyze the vibrations of systems and study the properties of materials. In engineering, it is used for signal processing and to analyze the frequency characteristics of electronic circuits. In biology, it is used to study brain activity and analyze the frequency components of biological signals.

• Mechanics
Replies
7
Views
1K
• Mechanics
Replies
3
Views
153
• Topology and Analysis
Replies
4
Views
519
• Mechanics
Replies
6
Views
546
• Engineering and Comp Sci Homework Help
Replies
7
Views
1K
• Topology and Analysis
Replies
7
Views
2K
• Astronomy and Astrophysics
Replies
1
Views
1K
• Calculus and Beyond Homework Help
Replies
1
Views
875
• Mechanics
Replies
4
Views
835
• Introductory Physics Homework Help
Replies
1
Views
1K