0

I am trying to compute the turbulence density spectrum with a Welch periodogram. The results seem good but I do not manage to find the fluctuation of streamwise velocity that I am supposed to find when computing the integral of the spectrum.

Here is my code:

sr = 833.3  # Sampling rate i.e. samples per second (1/dt with dt=0.0012)
Nysquid = sr/2

# Perform Welch's periodogram with Hann window and 50% overlap
seg_len = 4
segment = int(seg_len * sr)
myhann = signal.get_window('hann', segment)

# obtain Power density with Hann window and 50% overlap
myparams2 = dict(fs = sr, nperseg = segment, window = myhann, 
                 noverlap = segment/2, scaling = 'density', return_onesided=True)

# xdat is an array composed of the streamwise velocity at a given
# location and for many times.
freqn, xn = signal.welch(x = xdat, **myparams2)

I compute the velocity fluctuation from the measured data as:

U = xdat
U_std = np.std(U)
print("uu=", 0.5 * U_std**2) 

I should be able to recover this value by integrating the spectrum but I do not succeed in it.

What is the expression I should you to recover the velocity fluctuation using the energy spectrum?

Thanks a lot

Martin7
  • 93
  • 8
  • I thought you already calculated the velocity fluctuations. – mkrieger1 Jul 31 '23 at 16:10
  • I modified the equation for computing Euu, there was a mistake. I do not know if you referred to this but if not, could you be more specific? – Martin7 Aug 01 '23 at 06:12
  • You said "I compute the velocity fluctuation from the mesured data as ..." and "I compute the velocity fluctuation from the spectrum as ...", so you already computed it twice. What help do you need from us in computing it then? – mkrieger1 Aug 01 '23 at 07:51
  • I updated the post to reformulate the question – Martin7 Aug 01 '23 at 08:40

0 Answers0