Is my calculation of the power spectrum correct?

Click For Summary
SUMMARY

The discussion centers on the calculation of the power spectrum for X-ray observations using Fourier transforms. The participants debate two expressions for the power spectrum: \(P(\omega) = |A(\omega)|^2 * |W(\omega)|^2\) and \(P(\omega) = |A(\omega) * W(\omega)|^2\). They conclude that while both expressions can yield similar results under specific conditions, they are not universally equivalent due to differences in units and the nature of the functions involved. The conversation highlights the importance of understanding the definitions and conventions in Fourier analysis, particularly in the context of power spectral density estimation.

PREREQUISITES
  • Understanding of Fourier Transform principles
  • Familiarity with power spectral density (PSD) concepts
  • Knowledge of window functions in signal processing
  • Basic grasp of X-ray observational techniques
NEXT STEPS
  • Study the differences between energy spectral density and power spectral density
  • Learn about Welch's method for estimating power spectral density
  • Explore the implications of window functions on Fourier transforms
  • Investigate numerical methods for calculating power spectra from time series data
USEFUL FOR

Researchers and practitioners in astrophysics, signal processing engineers, and anyone involved in analyzing time series data from X-ray observations or similar fields.

arcTomato
Messages
104
Reaction score
27
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.
 
Physics news on Phys.org
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.
 
  • Like
Likes   Reactions: 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
 
  • Like
Likes   Reactions: arcTomato and Charles Link
@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:
  • Like
Likes   Reactions: 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! :oldsmile:
 
  • Like
Likes   Reactions: 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!
 
  • #10
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) ##.

 
  • #11
@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.
 
  • #12
@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.
 
  • #13
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'##).
 
  • #14
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.
 
  • #15
The first “definition” of P is wrong—it doesn’t follow from Fourier theory. Your second definition is correct.
 
  • Like
Likes   Reactions: hutchphd
  • #16
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.
 
  • #17
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.
 
  • Like
Likes   Reactions: vanhees71
  • #18
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.
 
  • Like
Likes   Reactions: vanhees71 and Twigg

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 17 ·
Replies
17
Views
969
Replies
9
Views
1K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K