-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fftFreq - what does it do? #103
Comments
This parameters specifies frequency (per time step if i'm not mistaking) of FFT procedure execution. 1024 means that FFT will be runned each 1024-th time step. |
Does it mean that the final FFT execution is based on all 39936 rows of p-data in cjn01's case? But why fft-data have a double frequency result (79872 rows)? |
No it means that if your execution has 4096 time steps, then FFT procedure will be executed over time data 4 times: on 1024-th, 2048-th, 3072-th and 4096-th time steps. If there is no window, then in each executiom time series will have 1024, 2048, 3072 and 4096 points. Regarding number of frequencies - this is a property of FFT. Resulting spectrum is symmetric and has 2*N points, where N - maximum number of frequencies for a given discrete time sequence. I think, you should read more about FFT theory somewhere. |
@mkraposhin Thanks for your reply. I understand now. |
What is the function of fftFreq in the commonSettings file?
I've run a simulation using the FWH GTFormulation. The acoustics were turned on for 0.1 s of simulation time, and the timestep was 2.5e-6 s. The *-time.dat files have 40000 rows of pFluct vs time data, as expected. However, the fft-*.dat files have 79872 rows of SPL vs Frequency data. Based on my fftFreq of 1024, I would expect 513 SPL vs Frequency values, unless fftFreq is different to nfft?
Furthermore, how is fft implemented for the libacoustics library, i.e, how does one arrive at the SPL vs. Frequency in the fft-*.dat file from the pFluct vs. time in the *-time.dat file.
I could just be misunderstanding something but I'd greatly appreciate any additional information regarding this.
Thank you
The text was updated successfully, but these errors were encountered: