Skip to content

Commit

Permalink
Use writable variable in fft.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboulware committed May 9, 2023
1 parent 36339d7 commit c8d25fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scos_actions/signal_processing/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ def get_fft(

# Resize time data for FFTs
time_data = np.reshape(time_data[: num_ffts * fft_size], (num_ffts, fft_size))

out_data = np.empty(len(time_data))
# Apply the FFT window if provided
if fft_window is not None:
if time_data.size > NUMEXPR_THRESHOLD:
ne.evaluate("time_data*fft_window", out=time_data, casting="same_kind")
ne.evaluate("time_data*fft_window", out=out_data, casting="same_kind")
else:
time_data *= fft_window
out_data = time_data * fft_window

# Take the FFT
complex_fft = sp_fft(time_data, norm=norm, workers=workers)
complex_fft = sp_fft(out_data, norm=norm, workers=workers)

# Shift the frequencies if desired
if shift:
Expand Down

0 comments on commit c8d25fb

Please sign in to comment.