MATLAB Answers

Separate a time signal for each frequency

조회 수: 4(최근 30일)
Erik Nilsson
Erik Nilsson 2020년 10월 26일
답변: Star Strider 2020년 10월 26일
I have a signal with acceleration over time and the auto spectrum (acceleration over frequency) for the same signal. The time signal is 1 second long and the auto spectrum goes up to 3200 Hz with an intervall of 1 Hz. I want to write a code so that I get a time signal for each frequency. Is this possible and which functions should I use? The code below displays 9 different time signals. The auto spectrum is not in this code.
I have tried to do this using the spectrogram function but can't make it work. I can display the draft of my code below. Is this the right function or how can I do this better? Please help me to solve this. When using the spectrogram function, the time signal goes up to 1,26 seconds even though my measurements only goes up to 1 second... And I want to have acceleration over time for each frequency, not the Power/frequency as I get with this code.
T = readtable('Measurement-1-dot.csv');
A = table2array(T);
Time=A(1:length(A),1);
Signal1=A(1:length(A),2);
Signal2=A(1:length(A),3);
Signal3=A(1:length(A),4);
Signal4=A(1:length(A),5);
Signal5=A(1:length(A),6);
Signal6=A(1:length(A),7);
Signal7=A(1:length(A),8);
Signal8=A(1:length(A),9);
Signal9=A(1:length(A),10);
%FFT
Fs = 6400; % Sampling frequency
[s,w,t]=spectrogram(A(1:length(A),9),kaiser(256,1),220,512,Fs,'yaxis');
spectrogram(A(1:length(A),9),kaiser(256,1),220,512,Fs,'yaxis');

채택된 답변

Star Strider
Star Strider 2020년 10월 26일
The pspectrum function (introduced in R2017b) with the 'spectrogram' type may be what you want. It produces a spectrogram plot and spectrogram output (if you ask it to), however with completely different units and resolution than the spectrogram function that you are currently using.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by