We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bc35a1 commit aa4f0b6Copy full SHA for aa4f0b6
sigpro/transformations/amplitude/fftfreq.py
@@ -0,0 +1,23 @@
1
+"""Build power spectrum from amplitude values."""
2
+
3
4
+import numpy as np
5
6
7
+def fft_freq(amplitude_values, sampling_frequency):
8
+ """Compute the Frequency having FFT values
9
10
+ Args:
11
+ amplitude_values (np.ndarray):
12
+ A numpy array with the signal values.
13
+ sampling_frequency (int or float):
14
+ Sampling frequency value passed in Hz.
15
+ Returns:
16
+ tuple:
17
+ * `amplitude_values (numpy.ndarray)`
18
+ * `frequency_values (numpy.ndarray)`
19
+ """
20
+ amplitude_values = amplitude_values
21
+ frequency_values = np.fft.fftfreq(len(amplitude_values), 1 / sampling_frequency)
22
23
+ return amplitude_values, frequency_values
0 commit comments