How to set Spectrogram parameters

9 ビュー (過去 30 日間)
Théo
Théo 2023 年 5 月 9 日
コメント済み: Mathieu NOE 2023 年 5 月 11 日
Hello Everyone,
I would like to print the spectrogram of a curve, in order to observe variations. But I don't really understand how to set the parameters of the function "spectrogram" even with the Matlab help.
For now I have this :
But I can't observe any variation. Is it possible to obtain something more like that :
There is my code and the attached file to get all the datas :
clear all;
clc ;
close all;
Valeurs = xlsread('C:\Users\tlam\Desktop\Run 80.xlsx',"Data1");
Temps = Valeurs(:,1);
Accelero = Valeurs(:,2);
Moteur_rpm = Valeurs(:,3);
BV_rpm = Valeurs(:,4);
Delta = Moteur_rpm - BV_rpm;
M_temps = max(Temps);
Moteur_Hz = Moteur_rpm * 0.016667;
BV_Hz = BV_rpm * 0.016667 ;
Delta_Hz = Delta * 0.016667;
%%
F = figure( 'Position', [50 50 1600 900]) ; % Visible 'off' pour ne pas afficher
t = tiledlayout(3,3,'TileSpacing','Compact','Padding','Compact');
title(t,"Spectro FULL ")
% Mot_rpm(t) et BV_rpm(t) Run 1
nexttile([1 2])
plot(Temps,Moteur_rpm,'red',Temps,BV_rpm,'green')
xlim ([0 M_temps])
ylabel('Moteur & BV [rpm]')
legend ('Moteur','Boite de Vitesse')
grid on
Fs = 50000; %Hz
% Spectrogramme Run 1
nexttile([2 1])
spectrogram(Accelero,100,99,100,Fs,'yaxis','power')
hold on
plot(Temps,Moteur_Hz,'r',Temps,BV_Hz,'g',Temps,Delta_Hz,'b')
colormap('jet')
% Delta(t) Run 1
nexttile([1 2])
plot(Temps,Delta,'blue')
xlim ([0 M_temps])
ylabel('Delta [rpm]')
grid on
% Accelero(t) Run 1
nexttile([1 2])
plot(Temps,Accelero,'magenta')
xlabel('temps [s]')
xlim ([0 M_temps])
ylabel('acceleromètre [V]')
grid on
  19 件のコメント
Théo
Théo 2023 年 5 月 11 日
You helped me a lot thank you !
Mathieu NOE
Mathieu NOE 2023 年 5 月 11 日
My pleasure !

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by