spectrogram

Programming a Spectrogram using C [closed]

爷,独闯天下 提交于 2019-12-04 08:04:58
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 experience or resource regarding this, please help; it would be much appreciated. So this is what I want to do: Read from mic input. Sample the data. Apply Short time Fourier transform. Then take the magnitude and plot it at the certain frequency. Something like this: http://upload.wikimedia.org/wikipedia/commons/c/c5/Spectrogram-19thC.png If you can help it would be great. 来源: https:/

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

耗尽温柔 提交于 2019-12-03 16:13:21
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 my head around the fact that frequency is scaled from 0 to 1.0 and time from 0 to 80k . What is the

Save an image (only content, without axes or anything else) to a file using Matloptlib

戏子无情 提交于 2019-12-03 09:02:57
I'd like to obtain a spectrogram out of a wav file and then save it to a png, but I need just the content of the image (not axes or anything else). I came across these questions Matplotlib plots: removing axis, legends and white spaces scipy: savefig without frames, axes, only content I've also read the Matplotlib documentation but it seems useless and so either answers to questions above are outdated or I'm doing something wrong because simple plt.savefig('out.png', bbox_inches='tight', pad_inches=0) does not do what I want to achieve. Initially I tried to follow this guide but the code

generating correct spectrogram using fftw and window function

时光怂恿深爱的人放手 提交于 2019-12-03 02:47:49
For a project I need to be able to generate a spectrogram from a .WAV file. I've read the following should be done: Get N (transform size) samples Apply a window function Do a Fast Fourier Transform using the samples Normalise the output Generate spectrogram On the image below you see two spectrograms of a 10000 Hz sine wave both using the hanning window function. On the left you see a spectrogram generated by audacity and on the right my version. As you can see my version has a lot more lines/noise. Is this leakage in different bins? How would I get a clear image like the one audacity

MATLAB 'spectrogram' params

坚强是说给别人听的谎言 提交于 2019-12-03 00:34:55
问题 I am a beginner in MATLAB and I should perform a spectral analysis of an EEG signal drawing the graphs of power spectral density and spectrogram. My signal is 10 seconds long and a sampling frequency of 160 Hz , a total of 1600 samples and have some questions on how to find the parameters of the functions in MATLAB, including: pwelch (x, window, noverlap, nfft, fs); spectrogram (x, window, noverlap, F, fs); My question then is where to find values ​​for the parameters window and noverlap I do

Converting a WAV file to a spectrogram

和自甴很熟 提交于 2019-12-02 19:51:09
Hi im very new to this thing so please bear with me. I am trying to convert a WAV file to a spectrogram but arent sure how to begin with. I read on something that says to read the PCM data(which i think is my WAV file) and store it in an array in the WavReader class before apply the FFT on it and converting it to GUI. Im currently using Naudio to achieve this but could not find anything that shows how to convert the WAV file to a spectrogram. Thanks Edit : I found out about converting PCM to FFT with Naudio and im stuck. using (var reader = new AudioFileReader("test1.wav")) { // test1.wav is

How to save a figure in a MAT-file?

允我心安 提交于 2019-12-02 11:29:16
问题 I want to save the image in a figure directly as a 256x256 size MAT-file. However, I found that the saved MAT-file sizes were different, and when using imagesc to display the image, it seemed to be a little different from the original image. I will show my code and hope someone could help me to solve it. spectrogram(x,window,L,N,fs); set(gcf,'position',[500,500,205,205]); set(gca,'Position',[0 0 1 1]); f=getframe(gcf); mat=getimage(gcf); save(['D:\matlab\speech\mydata\cleanmat\',strcat

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

别等时光非礼了梦想. 提交于 2019-12-02 09:47:50
问题 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 I cant find any consistent method to plot the output of scipy.signal.spectrogram in to pyqtgraph Thanks! 回答1: The output of the Scipy Spectrogram can be easily plotted as an ImageItem from pyqtgraph. Normally, the resulting Spectrogram is only in

How to save a figure in a MAT-file?

我与影子孤独终老i 提交于 2019-12-02 05:40:20
I want to save the image in a figure directly as a 256x256 size MAT-file. However, I found that the saved MAT-file sizes were different, and when using imagesc to display the image, it seemed to be a little different from the original image. I will show my code and hope someone could help me to solve it. spectrogram(x,window,L,N,fs); set(gcf,'position',[500,500,205,205]); set(gca,'Position',[0 0 1 1]); f=getframe(gcf); mat=getimage(gcf); save(['D:\matlab\speech\mydata\cleanmat\',strcat(int2str(i)),'.mat'],'mat','-v6'); save doesn't do anything unexpected here. The issue is that the direction

Spectrogram of a wave file

一曲冷凌霜 提交于 2019-11-30 16:14:10
I am trying to obtain spectrogram of a wav file in python. But it gives the error: 'module' object has no attribute 'spectrogram'. Here is the code : import scipy.io.wavfile from scipy.io.wavfile import read from scipy import signal sr_value, x_value = scipy.io.wavfile.read("test.wav") f, t, Sxx= signal.spectrogram(x_value,sr_value) Is there also any way to obtain the spectrogram of a wav file? Using scipy.fftpack we can plot fft contents as spectrogram. ** This is based on my old posting ** Sample Code Below. """Plots Time in MS Vs Amplitude in DB of a input wav signal """ import numpy import