Power Spectral Density, Welch Technique

In summary, the author is looking for a MATLAB code to calculate a power spectral density. He is not sure where to start to find it.
  • #1
glamotte7
19
0
Hello,

Does anyone know how to calculate a power spectral density from discrete data using Welch's method with Mathematica?

Matlab readily does this but I need to do it with Mathematica.

Any guidance would be appreciated.

glamotte7
 
Physics news on Phys.org
  • #3
Hello Bill,

I've carefully read the article you suggested which is not entirely, but a bit, over my head. I am new to DSP and so am trying to gain my footing. I'm sure that equation (5) of the paper you referenced would be an excellent approach. I'm not at all sure where to begin to write lines of code to accomplish this as the equation itself is a bit opaque to me. Breaking the data into overlapping segments certainly seems to be a part of the approach in the article, which is what I was expecting. Polynomial curve fitting of segments as well.

Have used the ListConvolve command in Mma and am very impressed with it's flexibility and how clear it makes convolving of the impulse response(kernal) with the data.

Guess that explains where I'm at with this. The whole problem is very intriguing and I suspect there are a number of learning points along the way. Not sure how to start though.

glamotte7
 
  • #4
Here is (5) from the paper roughly translated into Mathematica.

2 DeltaT/Nw Sum[Abs[1/Sqrt[Nd]Sum[w[[n]]x[[n]]^l E^((-I 2 Pi k(n-1))/Nd)]^2, {l, 1, Nw}], {n, 1, Nd}]

To use this you need to assign appropriate constant values to DeltaT, Nw, Nd, choose and initialize a windowing function in list w, choose and initialize some plausible time domain signal list x.

Then you should probably try using you data in both Matlab and Mathematica so you can compare the results and we start the process of trying to figure out why the results are completely different, what mistakes have been made, how to fix those, etc, etc, etc.

I would start with really really simple data. A single simple sine wave that exactly fills a single segment with complete cycles is always a nice start. Then the sum of two different sine waves. Then... you get the idea. Gradually ratchet it up with multiple windows and overlapping windows and more complicated time domain data, exterminating every small error before making the next step.

If Matlab anywhere in their documentation describes exactly what they do then we might avoid some of the confusion by trying to port the Matlab method to Mathematica, rather than me just grabbing the first random page that Google showed me and asking you if this was it.
 
  • #5
Bill,

OK. Thanks very much for the code. I'll try working with it as you recommended, very simple things first.

I'll check Matlab to see if they describe their approach elsewhere or what their exact code is. It didn't come up readily but maybe I can find it with more digging around.

glamotte7
 
  • #6
hi
I'm looking for a MATLAB code to calculate displacement psd (power spectral density) units[m2/(cycles/m)] vs spatial frequency units[cycles/m]
Could you do me a favor and help me
 

1. What is Power Spectral Density?

Power Spectral Density (PSD) is a measure of the distribution of power in a signal over various frequencies. It is a useful tool in signal processing and is often used to analyze the frequency content of a signal.

2. How is Power Spectral Density calculated?

Power Spectral Density is typically calculated using the Fourier transform of a signal. The Welch Technique is a commonly used method for calculating PSD, which involves dividing the signal into smaller segments, taking the Fourier transform of each segment, and then averaging the results to obtain a more accurate estimate of the PSD.

3. What is the purpose of using the Welch Technique for Power Spectral Density?

The Welch Technique is used to reduce the effects of windowing on the PSD calculation. Windowing is a technique used to reduce the noise in a signal, but it can also introduce artifacts in the PSD. The Welch Technique helps to minimize these artifacts and provide a more accurate estimate of the PSD.

4. What are some applications of Power Spectral Density and the Welch Technique?

Power Spectral Density and the Welch Technique are commonly used in fields such as signal processing, telecommunications, and vibration analysis. They can be used to analyze the frequency content of a signal, identify periodic components, and detect anomalies or abnormalities in a signal.

5. Are there any limitations to using Power Spectral Density and the Welch Technique?

One limitation of using PSD and the Welch Technique is that they assume the signal is stationary, meaning that its statistical properties do not change over time. If the signal is non-stationary, other techniques may need to be used. Additionally, the accuracy of the PSD calculation can be affected by the length and windowing of the signal segments, so careful consideration must be given to these parameters.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
399
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
801
  • Advanced Physics Homework Help
Replies
1
Views
818
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
Back
Top