Bugfix in lasp_measurement.py/CPS()

This commit is contained in:
Casper Jansen 2022-11-08 14:27:16 +01:00
parent 6517fb0029
commit e405ab8eea
1 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ from .lasp_config import LASP_NUMPY_FLOAT_TYPE
from scipy.io import wavfile
import os, time, wave, logging
from .lasp_common import SIQtys, Qty, getFreq
from .lasp_cpp import Window, DaqChannel, LASP_VERSION_MAJOR
from .lasp_cpp import Window, DaqChannel, LASP_VERSION_MAJOR, AvPowerSpectra
from typing import List
@ -480,18 +480,18 @@ class Measurement:
"""
nfft = kwargs.pop('nfft', 2048)
window = kwargs.pop('window', Window.hann)
window = kwargs.pop('windowType', Window.WindowType.Hann)
overlap = kwargs.pop('overlap', 50.0)
if channels is None:
channels = list(range(self.nchannels))
nchannels = len(channels)
aps = AvPowerSpectra(nfft, nchannels, overlap, window)
aps = AvPowerSpectra(nfft, window, overlap)
freq = getFreq(self.samplerate, nfft)
for data in self.iterData(channels, **kwargs):
CS = aps.addTimeData(data)
CS = aps.compute(data)
return freq, CS