Skip to content

Commit

Permalink
fft frequency transofrmation
Browse files Browse the repository at this point in the history
  • Loading branch information
SaraPido committed Nov 7, 2024
1 parent 70f2157 commit 7248fa8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
6 changes: 0 additions & 6 deletions sigpro/basic_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

This file was deleted.

21 changes: 2 additions & 19 deletions sigpro/transformations/frequency/fftfreq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 7248fa8

Please sign in to comment.