Skip to content

Commit

Permalink
new frequency primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
SaraPido committed Apr 23, 2024
1 parent 4bc35a1 commit aa4f0b6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sigpro/transformations/amplitude/fftfreq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Build power spectrum from amplitude values."""


import numpy as np


def fft_freq(amplitude_values, sampling_frequency):
"""Compute the Frequency having FFT values
Args:
amplitude_values (np.ndarray):
A numpy array with the signal values.
sampling_frequency (int or float):
Sampling frequency value passed in Hz.
Returns:
tuple:
* `amplitude_values (numpy.ndarray)`
* `frequency_values (numpy.ndarray)`
"""
amplitude_values = amplitude_values
frequency_values = np.fft.fftfreq(len(amplitude_values), 1 / sampling_frequency)

return amplitude_values, frequency_values

0 comments on commit aa4f0b6

Please sign in to comment.