spectrogram

How do I apply a binary mask and STFT to produce an audio file?

情到浓时终转凉″ 提交于 2019-12-06 15:57:42
问题 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.) from the inverse stft. Here's what I understand: stft is a simple equation that is applied to the audio file, which generates the information that can easily be displayed a spectrogram. By taking the inverse of the stft matrix, and multiplying it by a

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

点点圈 提交于 2019-12-06 12:59:27
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 using Librosa as an alternative to Kaldi. I set up my code as below using the same number of bins, sampling rate, and window length / shift as above. time_series, sample_rate = librosa.core.load("7a.wav",sr=20000) spectrogram = librosa.feature.melspectrogram(time_series, sr=20000, n_mels=23, n_fft=500, hop_length=200) log_S = librosa.core.logamplitude

How to do subtraction between 2 spectrogram and then draw a new one in MATLAB

佐手、 提交于 2019-12-06 12:18:58
问题 The two spectrograms are in the same dimension. I tried S = spectrogram() to get the vector S , but I don't know how to draw back to spectrogram with it. 回答1: In the documentation, it says that the images are drawn with the command surf(T,F,10*log10(abs(P))); . So for example, you could plot the difference of two of these images with: %# make some data T = 0:0.001:2; X1 = chirp(T,100,1,200,'q'); X2 = chirp(T,150,1,200,'q'); %# plot the first spectrogram subplot(3,1,1); spectrogram(X1,128,120

Programming a Spectrogram using C [closed]

房东的猫 提交于 2019-12-06 03:40:33
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I am trying to make an audio spectrogram in C and am thinking about using the BASS library: http://www.un4seen.com. I searched over Google and here, but majority of examples are in C++. If any of you have any

Get a spectrum of frequencies from WAV/RIFF using linux command line

徘徊边缘 提交于 2019-12-05 15:50:41
How to generate file including spectrum of frequencies of wav/riff sound file? I would like to use linux command line. I know the cool sox function to generate png spectrograms sox sound.wav -n spectrogram But I do not need visual representation of the spectrum of frequencies. I just want to get spectrum of frequencies in data file so I can work on them. I believe that there must be an option using sox. Sox need to generate that data before plotting it. How to get this? Not sure, maybe the second solution is exporting wav file into the dat file. Each sample from dat file is a measure of the

scipy.signal.spectrogram compared to matplotlib.pyplot.specgram

徘徊边缘 提交于 2019-12-05 07:59:22
The following code generates a spectrogram using either scipy.signal.spectrogram or matplotlib.pyplot.specgram . The color contrast of the specgram function is, however, rather low. Is there a way to increase it? import numpy as np from scipy import signal import matplotlib.pyplot as plt # Generate data fs = 10e3 N = 5e4 amp = 4 * np.sqrt(2) noise_power = 0.01 * fs / 2 time = np.arange(N) / float(fs) mod = 800*np.cos(2*np.pi*0.2*time) carrier = amp * np.sin(2*np.pi*time + mod) noise = np.random.normal(scale=np.sqrt(noise_power), size=time.shape) noise *= np.exp(-time/5) x = carrier + noise

How to change pyplot.specgram x and y axis scaling?

和自甴很熟 提交于 2019-12-05 02:03:46
问题 I have never worked with audio signals before and little do I know about signal processing. Nevertheless, I need to represent and audio signal using pyplot.specgram function from matplotlib library. Here is how I do it. import matplotlib.pyplot as plt import scipy.io.wavfile as wavfile rate, frames = wavfile.read("song.wav") plt.specgram(frames) The result I am getting is this nice spectrogram below: When I look at x-axis and y-axis which I suppose are frequency and time domains I can't get

How do I apply a binary mask and STFT to produce an audio file?

依然范特西╮ 提交于 2019-12-04 20:42:25
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.) from the inverse stft. Here's what I understand: stft is a simple equation that is applied to the audio file, which generates the information that can easily be displayed a spectrogram. By taking the inverse of the stft matrix, and multiplying it by a matrix of the same size (the binary matrix) you can create a new matrix with information to generate

How to do subtraction between 2 spectrogram and then draw a new one in MATLAB

假如想象 提交于 2019-12-04 18:36:09
The two spectrograms are in the same dimension. I tried S = spectrogram() to get the vector S , but I don't know how to draw back to spectrogram with it. In the documentation , it says that the images are drawn with the command surf(T,F,10*log10(abs(P))); . So for example, you could plot the difference of two of these images with: %# make some data T = 0:0.001:2; X1 = chirp(T,100,1,200,'q'); X2 = chirp(T,150,1,200,'q'); %# plot the first spectrogram subplot(3,1,1); spectrogram(X1,128,120,128,1E3); title('Quadratic chirp 100Hz') %# plot the second spectrogram subplot(3,1,2); spectrogram(X2,128

Different spectrogram between MATLAB and Python

限于喜欢 提交于 2019-12-04 11:17:32
I have a program in MATLAB which I want to port to Python. The problem is that in it I use the built-in spectrogram function and, although the matplotlib specgram function seems identical, I'm getting different results when I run both. These is the code I've been running. MATLAB: data = 1:999; %Dummy data. Just for testing. Fs = 8000; % All the songs we'll be working on will be sampled at an 8KHz rate tWindow = 64e-3; % The window must be long enough to get 64ms of the signal NWindow = Fs*tWindow; % Number of elements the window must have window = hamming(NWindow); % Window used in the