Skip to content

Commit 58ef2c7

Browse files
committed
changed frequency vector creation to avoid zero frequency
1 parent 1d18a32 commit 58ef2c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyLump.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,9 @@ def get_response(self, exc_dof:np.ndarray|list, exc:np.ndarray, sampling_rate:in
565565
raise Exception("Type int required for sampling_rate")
566566

567567
# freq array:
568-
freq = np.fft.rfftfreq(exc.shape[1], 1/sampling_rate)
568+
len_freq = exc.shape[1] // 2 + 1 # number of data points of frequency vector
569+
freq = np.arange(1, len_freq+1, 1) * (sampling_rate / exc.shape[1]) # avoid zero frequency
570+
#freq = np.fft.rfftfreq(exc.shape[1], 1/sampling_rate) # old
569571

570572
# # n_modes kwarg:
571573
n_modes = kwargs.get("n_modes", None)

0 commit comments

Comments
 (0)