필터 지우기
필터 지우기

how to plot 3d spectrogram from data in txt file

조회 수: 8 (최근 30일)
Venkatkumar M
Venkatkumar M 2021년 1월 6일
편집: Venkatkumar M 2021년 1월 15일
Hi guys ,
I have file which time domain of particular output.
clear all;
clc;
data = readmatrix('t.txt');
% Extract time into vector t, and the signal into vector y.
q = data(:, 1);
r = data(:, 2);
y=q.';
A=r.';
ts=(-y(1,2)+y(1,3))
fs=1/ts
t=fs/5
[sSTFT,f,time]=spectrogram(A,fs/5,0,fs/10,fs);
assoluto=abs(sSTFT);
figure
spectrogram(s,fs/10,0,1e6,fs)
i am getting this error.
Error using welchparse>segment_info (line 253)
The length of the segments cannot be greater than the length of the input signal.
Error in welchparse (line 34)
[L,noverlap,win] = segment_info(M,win1,noverlap1);
Error in pspectrogram (line 34)
[x,nx,~,y,ny,win,~,~,noverlap,~,~,options] = welchparse(x,esttype,varargin{:});
Error in spectrogram (line 170)
[varargout{1:nargout}] = pspectrogram({x},'spect',varargin{:});
Could anyone pls help me out to resolve the issue?
  댓글 수: 3
Walter Roberson
Walter Roberson 2021년 1월 6일
To deal with the 'B' suffix:
f = readmatrix('f.txt', 'Suffix', 'B');
Venkatkumar M
Venkatkumar M 2021년 1월 7일
you can negelect 'B' it is unit decibel(dB)

댓글을 달려면 로그인하십시오.

채택된 답변

Mathieu NOE
Mathieu NOE 2021년 1월 7일
hi
using Walter's code above + the attachement , you have all the tools to do this spectrogram analysis
all the best

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by