sig = np.random.randn(n_samples)
// Compute the FFT
fft_output = np.fft.fft(sig)freqs = np.fft.fftfreq(len(sig), 1. / fs)
// Rotate spectrum and invert, zscore to normalize.
// Note: the delta exponent to be applied is divided by two, as
// the FFT output is in units of amplitude not power
fft_output_rot = rotate_powerlaw(freqs, fft_output, -exponent/2)
sig = zscore(np.real(np.fft.ifft(fft_output_rot)))
if f_range is not None:
sig = filter_signal(sig, fs, infer_passtype(f_range), f_range, **filter_kwargs)
After Change
remove_edges=True, **filter_kwargs)
// Drop the edges, that were compensated for, if not using IIR (using FIR)
if not filter_kwargs.get("filt_type", None) == "iir":
sig, _ = remove_nans(sig)
return sig