You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how to use stft like scipy.signal "f, t, tf_data = signal.stft(wavedata, fs=fs, window='hamming', nperseg=N_fft, noverlap=int(N_fft*0.8))"? Now we cannot get f,t value. The tf_data is different from var spectrogram = stft.Spectrogram(discreteSignal, normalize: true).
#78
Open
John1911603424 opened this issue
May 6, 2023
· 2 comments
varN=10000;varfs=16000;varwavedata= Enumerable.Range(0, N).Select(i =>2*Math.Cos(2*Math.PI*200/fs*i)).ToFloats();varN_fft=1024;varoverlapSize=(int)(N_fft*0.8);varhopSize=N_fft-overlapSize;varstft=new Stft(N_fft, hopSize, WindowType.Hamming);vartf_data= stft.Direct(wavedata);// tf_data is array of complex spectra (i.e. array of complex arrays)// ...// note. Numbers may differ slightly from sciPy's version. // Also, not normalized by default. If necessary, divide by (N_fft/2 + 1).// .........// f and t can be calculated separately:varfreqResolution=(double)fs /N_fft;varfreqBinCount=N_fft/2+1;varf= Enumerable.Range(0, freqBinCount).Select(f =>f*freqResolution).ToArray();vartimeResolution=(double)hopSize /fs;vart= Enumerable.Range(0, tf_data.Count()).Select(t =>t*timeResolution).ToArray();
No description provided.
The text was updated successfully, but these errors were encountered: