Math ClubMath Club
v1 · padrão canônico

DFT e FFT — Análise Espectral Discreta

Transformada Discreta de Fourier (DFT): definição, propriedades, convolução circular. Algoritmo FFT de Cooley-Tukey. Análise espectral, janelamento e resolução em frequência.

Used in: engenharia

Choose your door

Real scenarios with market data and step-by-step calculations

FFT em Engenharia e Processamento de Sinais

Análise Espectral de Vibração

Para monitoramento de máquinas rotativas, a FFT das vibrações revela:

  • Frequência fundamental de rotação e harmônicas
  • Frequências de falha de rolamentos (BPFO,BPFI,BSFBPFO, BPFI, BSF)
  • Ressonâncias estruturais
import numpy as np
from scipy.fft import fft, fftfreq

# Simular sinal de vibração com 2 frequências e ruído
fs = 1000          # taxa de amostragem [Hz]
N  = 2048          # número de amostras
t  = np.arange(N) / fs

x = 1.0*np.sin(2*np.pi*50*t) + 0.5*np.sin(2*np.pi*120*t) + 0.1*np.random.randn(N)

# FFT com janela Hann (reduz leakage)
window = np.hanning(N)
X = fft(x * window)
freqs = fftfreq(N, 1/fs)

# Espectro unilateral (frequências positivas)
idx = freqs >= 0
magnitude = 2 * np.abs(X[idx]) / N  # normalização pela janela

# Picos principais
from scipy.signal import find_peaks
peaks, _ = find_peaks(magnitude, height=0.1)
print("Frequências dominantes [Hz]:", freqs[idx][peaks])

Convolução Eficiente via FFT

def fft_convolve(x, h):
    """Convolução linear via FFT (equivalente a np.convolve mas O(N log N))."""
    N = len(x) + len(h) - 1
    N_fft = 2**int(np.ceil(np.log2(N)))  # próxima potência de 2
    X = fft(x, n=N_fft)
    H = fft(h, n=N_fft)
    y = np.real(np.fft.ifft(X * H))
    return y[:N]

# Verificar contra np.convolve
x = np.random.randn(500)
h = np.array([0.25, 0.5, 0.25])  # filtro média simples
y_fft = fft_convolve(x, h)
y_ref = np.convolve(x, h)
print(f"Erro máximo: {np.max(np.abs(y_fft - y_ref)):.2e}")

Referência: Cooley & Tukey (1965) "An Algorithm for the Machine Calculation of Complex Fourier Series", Mathematics of Computation 19:297–301 (artigo original da FFT); Oppenheim & Schafer, Discrete-Time Signal Processing, Cap. 9.

To continue

Referências Bibliográficas

  • Oppenheim, A.V.; Schafer, R.W. Discrete-Time Signal Processing, 3ª ed. Prentice Hall, 2009. Caps. 8–9 (DFT, propriedades, FFT). Referência central.
  • Cooley, J.W.; Tukey, J.W. "An Algorithm for the Machine Calculation of Complex Fourier Series." Mathematics of Computation, 19(90):297–301, 1965. (Artigo original da FFT.)
  • Proakis, J.G.; Manolakis, D.G. Digital Signal Processing, 4ª ed. Prentice Hall, 2007. Caps. 5–6 (DFT e implementação FFT).
  • Harris, F.J. "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform." Proceedings of the IEEE, 66(1):51–83, 1978. (Referência clássica de janelamento.)
  • Strang, G. Introduction to Linear Algebra, 5ª ed. Wellesley-Cambridge Press, 2016. §8.3 (DFT e matrizes circulantes).
  • Higham, N.J. Accuracy and Stability of Numerical Algorithms, 2ª ed. SIAM, 2002. §3.11 (análise de erro da FFT).
  • Numerical Recipes in C, 2ª ed. Cambridge Univ. Press, 1992. §12 (FFT e aplicações práticas).

Updated on 2026-05-28 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.