From 7248fa879b6cc9c2f0f827aaeb2e7bc6a2145043 Mon Sep 17 00:00:00 2001 From: SaraPido Date: Thu, 7 Nov 2024 13:39:19 -0500 Subject: [PATCH] fft frequency transofrmation --- sigpro/basic_primitives.py | 6 ---- .../frequency/fftfreq/fft_freq_allband.json | 30 ------------------- sigpro/transformations/frequency/fftfreq.py | 21 ++----------- 3 files changed, 2 insertions(+), 55 deletions(-) delete mode 100644 sigpro/primitives/sigpro/transformations/frequency/fftfreq/fft_freq_allband.json diff --git a/sigpro/basic_primitives.py b/sigpro/basic_primitives.py index fd9f6ed..2eab9f8 100644 --- a/sigpro/basic_primitives.py +++ b/sigpro/basic_primitives.py @@ -36,12 +36,6 @@ def __init__(self): super().__init__("sigpro.transformations.frequency.fftfreq.fft_freq") -class FFTFreqAllBand(primitive.FrequencyTransformation): - """FFT Freq All Band primitive class.""" - - def __init__(self): - super().__init__("sigpro.transformations.frequency.fftfreq.fft_freq_allband") - class FFTReal(primitive.FrequencyTransformation): """FFTReal primitive class.""" diff --git a/sigpro/primitives/sigpro/transformations/frequency/fftfreq/fft_freq_allband.json b/sigpro/primitives/sigpro/transformations/frequency/fftfreq/fft_freq_allband.json deleted file mode 100644 index a9f73c0..0000000 --- a/sigpro/primitives/sigpro/transformations/frequency/fftfreq/fft_freq_allband.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "sigpro.transformations.frequency.fftfreq.fft_freq_allband", - "primitive": "sigpro.transformations.frequency.fftfreq.fft_freq_allband", - "classifiers": { - "type": "transformation", - "subtype": "frequency" - }, - "produce": { - "args": [ - { - "name": "amplitude_values", - "type": "numpy.ndarray" - }, - { - "name": "sampling_frequency", - "type": "float" - } - ], - "output": [ - { - "name": "amplitude_values", - "type": "numpy.ndarray" - }, - { - "name": "frequency_values", - "type": "numpy.ndarray" - } - ] - } -} diff --git a/sigpro/transformations/frequency/fftfreq.py b/sigpro/transformations/frequency/fftfreq.py index 2e881e3..cc8eaa0 100644 --- a/sigpro/transformations/frequency/fftfreq.py +++ b/sigpro/transformations/frequency/fftfreq.py @@ -16,24 +16,7 @@ def fft_freq(amplitude_values, sampling_frequency): * `amplitude_values (numpy.ndarray)` * `frequency_values (numpy.ndarray)` """ - frequency_values = np.fft.fftfreq(len(amplitude_values), 1 / sampling_frequency) - - return np.array(amplitude_values), np.array(frequency_values) - -def fft_freq_allband(amplitude_values, sampling_frequency): - """Compute the Frequency having FFT values. - - Args: - amplitude_values (np.ndarray): - A numpy array with the fft values. - sampling_frequency (int or float): - Sampling frequency value passed in Hz. - Returns: - tuple: - * `amplitude_values (numpy.ndarray)` - * `frequency_values (numpy.ndarray)` - """ - + #frequency_values = np.fft.fftfreq(len(amplitude_values), 1 / sampling_frequency) frequency_values = np.arange(0, len(amplitude_values)) * sampling_frequency - + return np.array(amplitude_values), np.array(frequency_values) \ No newline at end of file