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.
Questions tagged [spectrogram]
502 questions
0
votes
2 answers
Which Spectrogram best represents features of an audio file for CNN based model?
I am looking to understand various spectrograms for audio analysis. I want to convert an audio file into 10 second chunks, generate spectrograms for each and use a CNN model to train on top of those images to see if they are good or bad.
I have…

Teja8484
- 69
- 2
- 10
0
votes
1 answer
too many indicies for an array
I've used the code from user Anil_M in this question i want to get the same result. but in My case it plots the first image
and after that i get an error
Traceback (most recent call last):
File…

skdadle
- 155
- 1
- 2
- 17
0
votes
1 answer
Tuple index out of range : Audio to spectrogram
I am trying to run an audio to spectrogram script, namely:
https://github.com/grrrr/nsgt/tree/master/examples
When I try python spectrogram.py myaudio.wav
I get the error:
Traceback (most recent call last):
File "spectrogram.py", line 111, in…

Curiousmarble
- 29
- 5
0
votes
0 answers
Reading off Amplitude from scipy spectrogram
It seems to me that the amplitude calculated in scipy.signal.spectrogram is not correct (in my case about 20% off). Is it possible to improve on this? Consider this example
import matplotlib.pyplot as plt
import numpy as np
from numpy import pi as…

varantir
- 6,624
- 6
- 36
- 57
0
votes
0 answers
Matplotlib - Tuning color parameters for spectrograms
I am tuning color settings of matplotlib images, but I am not sure which parameters should I toggle.
Currently, my image looks like this:
But I would like it to be like this:
As shown, the whole color settings look darker and blur.
I've tried…

sealpuppy
- 615
- 4
- 12
- 27
0
votes
0 answers
Plot signal spectrogram image for each time step in python
I want to print a spectrogram image for each time step
This is what i have tried
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
NFFT = 256 # the length of the windowing segments
Fs = 64 # the sampling…

Hadeer Zayat
- 61
- 1
- 8
0
votes
0 answers
How to display a spectogram inside a UIFigure?
I am trying to display a spectogram in a UIAxes using app designer in MATLAB 2018. The best method I've seemed to find is a workaround where I display a colored image of the spectogram as below. I've used an empty UIFigures position so that all my…

Intent Filters
- 189
- 1
- 15
0
votes
1 answer
Remove the microseconds from matplotlib spectrogram
I've been trying to plot an spectogram based on a wav file of 15 minutes lenght. I think I managed to do this, but I can't remove the microseconds from my x axis ( time axis). Any help with this, please?
This is the spectrogram obtained:
This is…

PyRar
- 539
- 1
- 4
- 21
0
votes
0 answers
Get more time points on x axis of a spectrogram
So I've represented a spectrogram for a relatively long video(15 minutes). On the time axis, I've got data points at each 3 minute and 20 seconds.
This is my spectrogram:
I would like to have data point on the x axis for every second. I've tries to…

PyRar
- 539
- 1
- 4
- 21
0
votes
1 answer
how to plot time-frequency graph through spectrogram?
I'm trying to plot time-frequency graph through a spectrogram. I want to make one line graph (x axis = time, y axis = frequency). I use Python and signal.stft function and get a spectrogram. I also calculate max frequency value in each time step.…

YUN
- 1
- 2
0
votes
0 answers
Keep the aspect ratio of an image based on the fft of a wave file
I am using
import matplotlib.pyplot as plt
from scipy.io import wavfile
import numpy as np
def graph_spectrogram(wav_file,png_file):
rate, data = wavfile.read(wav_file)
fig,ax = plt.subplots(1)
…

Fabien Biller
- 155
- 1
- 1
- 10
0
votes
1 answer
Matlab spectrograms giving imaginary-like numbers
I'm using MATLAB to work with some spectrograms. I'm new to this kind of thing and come from more of a CS background than a signals background, so I'm not sure what I'm missing here although it may turn out to be fairly basic.
I'm trying to compute…

Tessa K
- 1
- 1
0
votes
1 answer
How to compute "normalized" frequency from Mel Spectrogram?
I have computed the mel spectrogram with librosa like that:
self.Spectrogram = librosa.feature.melspectrogram(y=self.RawSignal, sr=self.sampling_frequency,
n_mels=128, fmax=8000)
I need to…

LiukPet
- 93
- 10
0
votes
1 answer
How do I apply a binary mask and STFT to produce an audio file?
So here's the idea: you can generate a spectrogram from an audio file using shorttime Fourier transform (stft). Then some people have generated something called a "binary mask" to generate different audio (ie. with background noise removed etc.)…

Blake H
- 23
- 8
0
votes
0 answers
plotting very large 2D color map / waterfall / spectrogram
I am using matplotlib's pcolormesh for 2D plotting of large sets of X Y Z data where Z is the color intensity.
I get the plots I want, but as the data is getting larger, the plotting gets slower and slower (> 30 min for each plot).
Is there any way…

xaratustra
- 647
- 1
- 14
- 28