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
3
votes
2 answers

Why spectrogram from librosa library have twice the time duration of the actual audio track?

I am using the following code to obtain Mel spectrogram from a recorded audio signal of about 30 s: spectrogram = librosa.feature.melspectrogram(y=self.RawSamples,sr=self.SamplingFrequency, n_mels=128, fmax=8000) if show: …
LiukPet
  • 93
  • 10
3
votes
1 answer

how to convert audio data to fourier on jupyter notebook?

I want to convert mp3 files using courier's transform and export as spectrogram.Then I need to save as PNG file containing all frequencies of my mp3. How can I do that by using jupyter notebook?
pinkdolphin
  • 303
  • 1
  • 3
  • 7
3
votes
1 answer

python - spectrogram divide by zero encountered in log10 warning

i tried to generate a spectrogram for each axis in my dataset here what i tried dataset = np.loadtxt("trainingdataset.txt", delimiter=",", dtype = np.int32) fake_size = 1415684 time = np.arange(fake_size)/1415684 # 1kHz base_freq = 2 * np.pi *…
Hadeer El-Zayat
  • 281
  • 5
  • 20
3
votes
1 answer

scipy.signal.spectrogram nfft parameter

What does nfft parameter mean in this function? Please refer to this link for the documentation https://docs.scipy.org/doc/scipy-0.19.0/reference/generated/scipy.signal.spectrogram.html
Chaine
  • 1,368
  • 4
  • 18
  • 37
3
votes
1 answer

Spectrograms generated using Librosa don't look consistent with Kaldi?

I generated spectrogram of a "seven" utterance using the "egs/tidigits" code from Kaldi, using 23 bins, 20kHz sampling rate, 25ms window, and 10ms shift. Spectrogram appears as below visualized via MATLAB imagesc function: I am experimenting with…
kashkar
  • 663
  • 1
  • 8
  • 22
3
votes
3 answers

Spectrogram of two audio files (Added together)

Assume for a moment I have two input signals f1 and f2. I could add these signals to produce a third signal f3 = f1 + f2. I would then compute the spectrogram of f3 as log(|stft(f3)|^2). Unfortunately I don't have the original signals f1 and f2. I…
user667804
  • 740
  • 6
  • 25
3
votes
1 answer

matlab spectrum returns more FRAME than expected

I'm using the following code to get specgram2D from np array: specgram2D, freq, time = mlab.specgram(samples, Fs=11025, NFFT=1024, window=mlab.window_hanning, noverlap=int(1024 * 0.5)) Then I print out specgram2D like print len(specgram2D) #…
moeseth
  • 1,855
  • 5
  • 23
  • 47
3
votes
2 answers

Draw spectrogram graph of audio file in android

I'm developing an Android application in which I need to create a graph of spectrogram (which is a visual representation of the spectrum of frequencies in a sound as they vary with time). I had an audio file and use FFT to have signal in frequency…
sandra
  • 949
  • 3
  • 12
  • 25
3
votes
1 answer

Create a spectrogram in python (without drawing)

I'm trying to create a spectrogram object for audio analysis. I'm using Snack Library. This library, create the spectrogram as a canvas object but I should use the spectrogram as a numerical object (every 10 ms I should extract the vector of…
elviuz
  • 639
  • 1
  • 7
  • 26
3
votes
1 answer

2D plot of a matrix with colors like in a spectrogram

How to plot, with Python, a 2D matrix A[i,j] like this: i is the x-axis j is the y-axis A[i,j] is a value between 0 and 100 that has to be drawn by a colour (ex: 0=blue, 100=red) Is there a Python function for that? (NB: I don't want a function…
Basj
  • 41,386
  • 99
  • 383
  • 673
3
votes
3 answers

Save Spectrogram as an Image in MATLAB

I'm analyzing some sound clips using the spectrogram() function in MATLAB. I would like to save the spectrogram as an image (jpg, png, etc). But regardless of what image format I save the figure in, the resulting image always looks different…
shapeshifter
  • 43
  • 1
  • 10
3
votes
2 answers

Map a value [0.0-1.0] to color gain

I need to translate values from 0.0 to 1.0 to their color representations (each value is a pixel). I am making a spectrogram, so the higher the value the brightest the pixel should be (as in the below image). How can I do this? I am working in C#…
c0dehunter
  • 6,412
  • 16
  • 77
  • 139
2
votes
0 answers

How to calculate the phases after a pitch shift on the STFT?

I use torch.stft() to generate a spectrogram. I want to perform a pitch shift on the audio. The end result should be an STFT of the pitch-shifted audio. I can't phase_vocoder -> istft -> resample -> stft because that's too slow. Instead, I wrote…
2
votes
0 answers

Mel-spectrogram vs MFCC for Automatic Speech Recognition

I am trying to do Automatic Speech Recognition using CNN. For the feature extraction I am using MFCC. I have read many articles, some of them say with lot of data and classifiers like CNN, mel spectorgram are better while others say MFCC is…
2
votes
1 answer

Normalize a melspectrogram to (0, 255) with or without frequency scaling

I am converting multiple log-mel spectrograms from .wav files to images. I want to destroy as little information as possible as I plan to use the resulting images for a computer vision task. To convert the data to an image format, I currently use a…