data isolation from spectogram
3 ビュー (過去 30 日間)
古いコメントを表示
I have a spectogram (from an audio file) from which i want to isolate/extract the line with the highest power, most intense color. how can i do this?
the code for the spectogram is as follows.
[A,Freq]=audioread(['bmw s100rr 0-300.mp3']);
NFFT=6000;
spectrogram(A,NFFT,NFFT/2,NFFT,Freq,'yaxis');colormap('jet');
ylim([0 1.8])
the acomponying spectogram can be seen below.
how can I isolate the dark red/black line and gather/isolate its values/plot it in a different graph.
0 件のコメント
回答 (1 件)
AH
2022 年 10 月 19 日
The function tfridge can be found helpful here. Below is an example showing how to extract the ridge from the spectrogram.
%% Signal model
fs = 3.6e3; % sampling rate in Hz
t0 = 2; % signal duration in seconds
t = (0:1/fs:t0)'; % time samples
x = vco(sawtooth(2*pi*t,0.5),[0.1 0.4]*fs,fs);
%% Spectrogram
NFFT = 256; % number of FFT points
[S,F,T] = spectrogram(x,NFFT,NFFT/2,NFFT,fs,'yaxis');
spectrogram(x,NFFT,NFFT/2,NFFT,fs,'yaxis')
%% Extract ridge (highest power)
[fridge,~,lridge] = tfridge(S,F);
ridge = S(lridge);
%% Figure
figure
spectrogram(x,NFFT,NFFT/2,NFFT,fs,'yaxis')
hold on
plot3(T,fridge/1e3,abs(ridge),'k','LineWidth',2)
For more complicated time-frequency maps, the input penalty in the tfridge should be tuned. Further information can be found in the documentation page (link to Documentation page). Another useful function/GUI is rpmtrack (link) where points on the ridge with the highest power can be inserted manually to further help ridge extraction.
In addition, it would be great if the audio file could be shared.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!