Smoothing
This document provides an overview of the fft methods.
fft(df, x_column, y_column, n=None, window=None, beta=None)
Computes the Fast Fourier Transform (FFT) of a signal in a DataFrame. Interpolates onto equally spaced x values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The input DataFrame containing the signal. |
required |
x_column
|
str
|
The name of the column representing the x-axis (time or frequency). |
required |
y_column
|
str
|
The name of the column representing the y-axis (signal values). |
required |
n
|
int
|
Number of points to compute the FFT. If None, uses the length of the signal. |
None
|
window
|
Window
|
Window function to apply before FFT. If None, no window is applied. |
None
|
beta
|
float
|
Beta parameter for the Kaiser window. Required if the Kaiser window is used. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A DataFrame containing the frequency and FFT amplitude. |
Source code in src/quantalyze/core/fft.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
Window
Bases: Enum
An enumeration representing different types of window functions for signal processing.
Attributes:
| Name | Type | Description |
|---|---|---|
HANN |
str
|
Hann window. |
HAMMING |
str
|
Hamming window. |
BLACKMAN |
str
|
Blackman window. |
BARTLETT |
str
|
Bartlett window. |
KAISER |
str
|
Kaiser window, requires an additional beta parameter. |
Methods:
| Name | Description |
|---|---|
get_window |
int, beta: Optional[float] = None) -> np.ndarray: Generates the specified window function as a NumPy array. Parameters: length (int): The length of the window. beta (Optional[float]): The beta parameter for the Kaiser window. Required only for the Kaiser window. Returns: np.ndarray: The generated window function. Raises: ValueError: If the Kaiser window is selected but the beta parameter is not provided. ValueError: If an unsupported window type is specified. |