MulaiMulai sekarang secara gratis

Spectrograms of heartbeat audio

Spectral engineering is one of the most common techniques in machine learning for time series data. The first step in this process is to calculate a spectrogram of sound. This describes what spectral content (e.g., low and high pitches) are present in the sound over time. In this exercise, you'll calculate a spectrogram of a heartbeat audio file.

We've loaded a single heartbeat sound in the variable audio.

Latihan ini adalah bagian dari kursus

Machine Learning for Time Series Data in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Import the stft function
____

# Prepare the STFT
HOP_LENGTH = 2**4
spec = ____(audio, hop_length=HOP_LENGTH, n_fft=2**7)
Edit dan Jalankan Kode