Questions tagged [spectrogram]

A spectrogram, or sonogram, is a visual representation of the spectrum of frequencies in a sound, at each time. Spectrograms are also called spectral waterfalls, voiceprints, or voicegrams. Spectrograms are used extensively in the development of the fields of music, sonar, radar, and speech processing, seismology, etc.

502 questions
2
votes
0 answers

Converting a audio file into a spectrogram then saving the data of the spectrogram into a txt file

Im doing a CNN to reconize birds sounds, i know how to get the image of the spectrogram from a wav audio and save it, but ploting 46k images is taking too long, someone told me to save the data of the spectrogram into a txt file, and it can train…
2
votes
2 answers

Plot audio waveform and spectrogram overlap

I am working with audio using librosa, and I need to plot the spectrogram and waveform in the same display. My code: plt.figure(figsize=(14, 9)) plt.figure(1) plt.subplot(211) plt.title('Spectrogram') librosa.display.specshow(stft_db,…
Ari
  • 21
  • 1
  • 3
2
votes
1 answer

Creating similar spectrogram in continues wavelet transform compared to discret wavelet transform

Using PyWavelets and Matplotbib.Specgram on a signal gives more detailed plots with pywt.dwt then pywt.cwt. How can I get a pywt.cwt specgram in a similar way? With dwt: import pywt import pywt.data import matplotlib.pyplot as plot from scipy import…
Luc Pingo
  • 23
  • 2
  • 5
2
votes
0 answers

Identification of time-dependent signals from a spectrogram

I am trying to trace several signals through time from a spectrogram. The issue is that as time evolves, the signals shift in frequency, so can be difficult to isolate them. (See images below) Is there a python function out there that is capable of…
Oak Nelson
  • 75
  • 11
2
votes
1 answer

How to convert a wav file into RGB image with melspectogram?

I am working on sound classification with wav files ranging from 1 second to 4 second. i want to convert wav to 224x224x3 image that i can fee into Resnet for classification The conversion should be using melspectogram Thanks for help
2
votes
1 answer

How to speed up spectrogram computation with tensorflow?

I want to compute spectrogram of 1-second audio clip for each frame in a video file. I use tensorflow.contrib.framework.python.ops.audio_ops.audio_spectrogram function to compute the spectrogram. The audio extracted from the video and sampled at 48…
Ronald Sumbayak
  • 135
  • 2
  • 11
2
votes
1 answer

normalizing mel spectrogram to unit peak amplitude?

I am new to both python and librosa. I am trying to follow this method for a speech recognizer: acoustic front end My code: import librosa import librosa.display import numpy as np y, sr = librosa.load('test.wav', sr = None) normalizedy =…
sabri
  • 23
  • 1
  • 8
2
votes
1 answer

Understanding scipy.signal.spectrogram()'s output

I am trying to understand what the scipy.signal.spectrogram()'s output are, and how to use them. Currently, I read a .wav file and generate a spectrogram. from scipy.io import wavfile as wav from scipy import signal sample_rate, data =…
dwb
  • 2,136
  • 13
  • 27
2
votes
1 answer

python numpy error "TypeError: 'numpy.float64' object cannot be interpreted as an integer"

I want to convert the .wav file into a Spectrogram. So I used this Python file. import glob import numpy as np from matplotlib import pyplot as plt import scipy.io.wavfile as wav from numpy.lib import stride_tricks """ short time fourier transform…
hayeon
  • 31
  • 3
  • 7
2
votes
1 answer

plotting the spectrum of a wavfile in pyqtgraph using scipy.signal.spectrogram

I have a PyQt plus pyqtgraph program for music and speech analysis and I want to plot the spectrum of a wav file (calculated using scipy python package). I can do it in matplotlib but due to matplotlib's performance I need to switch to pyqtgraph but…
Arraiz
  • 77
  • 1
  • 8
2
votes
1 answer

Parameters to control the size of a spectrogram

I am trying to get the spectrogram as described by the following instruction. Each audio segment has duration of 5s. Frames with equal size are extracted from the audio (with overlap between the consecutive frames), and each of the frame…
Raven Cheuk
  • 2,903
  • 4
  • 27
  • 54
2
votes
0 answers

spectrogram to power spectrum density

How do I compute the power spectrum density from the spectrogram? I found the following code but there is quite some difference when comparing to welch's method. Also I don't quite understand why I have to divide by 2 and nperseg? fs = 10e3 N =…
user307380
  • 55
  • 1
  • 4
2
votes
1 answer

How do I display a spectrogram from a wav file in C++?

I am doing a project in which I want to embed images into a .wav file so that when one sees the spectrogram using certain parameters, they will see the hidden image. My question is, in C++, how can I use the data in a wav file to display a…
Ibrahim
  • 1,209
  • 1
  • 11
  • 16
2
votes
1 answer

How do I add colors to my spectrogram?

so I found the following code that spits out a spectrogram. However, i'd like to add some random colours to it via colormap or other methods. I've read the cmap documentation and didn't understand a thing. The code: import matplotlib.pyplot as…
song
  • 83
  • 2
  • 7
2
votes
0 answers

how to extract a spectrogram signal from accelerometer signals stored in text file?

i try to convert my accelerometer signal (x-axis) and (y-axis) and (z-axis) into spectrogram by calculating the magnitude the dataset is divided into three text files for x,y and z respectively each file contains one column and 1000 rows. and this…