How to find the exact frequencies from a spectrogram plot?
Mostrar comentarios más antiguos
I have a spectrogram plot generated from oscilloscope data. I want to know what the exact frequency is at Maximum intensity. How do I got about extracting this type of information from the spectrogram and accompanying [S,F,T] data.

clear;
close all;
clc;
%% Initialization
struct = readmatrix('filename.csv');
shift = struct(6,2); %Horizontal Offset [s]
samp_interval = struct(2,2); %Sampling interval [s]
Fs = 1/samp_interval; %Sampling frequency [Hz]
total_t = struct(1,2)*samp_interval; %Total sampling time [s]
time = (struct(:,4)-shift)*1e9; %time [ns]
voltage = struct(:,5)*1000; %raw voltage data [V]
%% Highpass filter
high = 3e11;
voltage = highpass(voltage,high,Fs);
%% Spectrogram Setup
nfft = 2^nextpow2(length(voltage)); %FFT size (reduces time domain aliasing)
%Number of frequency samples
nspec = 1024*30; %Number of windows
wind = blackman(nspec); %Reduces side lobes that hide weaker signals
noverlap = nspec/2; %Overlap of windows
%% FFT Computation
freq_fft = (0:(nfft/2-1))*(Fs/nfft);
volt_f = fft(voltage,nfft);
%% Spectrogram
[s,f,t] = spectrogram(voltage ,wind,noverlap,nspec,Fs,'yaxis');
%% Plots
figure(1)
spectrogram(voltage,wind,noverlap,nspec,Fs,'yaxis')
ylim([0 15]); yticks(0:1:15); colormap('jet')
% figure(2)
% plot(freq_fft,abs(volt_f(1:nfft/2)))
% title('Single-Sided Amplitude Spectrum of V(t)')
% xlabel('Frequency (Hz)')
% ylabel('|V(f)|')
% axis tight
1 comentario
NewLad
el 19 de Abr. de 2023
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spectral Measurements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
