Find phase plot between input and output experimental data?
Mostra commenti meno recenti
Actually, I want to know the practical system's frequency response (bandwidth).
The input to the system is a sine wave with varying frequencies (frequency sweep)
plotted the magnitude and phase response using FFT, the magnitude plot was okay but the phase was weird
is there any other way to get correct phase plot or to cross verify the phase plot?
2 Commenti
Rik
il 18 Feb 2023
@Anil I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
@Star Strider Unfortunately I was unable to find a cached version of your comment, nor would the file be included in that cache, so I left your flag in place.
Rena Berman
il 9 Mar 2023
(Answers Dev) Restored edit
Risposte (1)
Star Strider
il 11 Feb 2023
0 voti
I am not certain what function created that plot (it might have been the System Identification Toolbox bode function.)
See if the unwrap function will do what you want. It may be necessary to get the outputs of bode, use unwrap on the phase vector, and then re-plot the data using your own subplot call.
1 Commento
I am having a difficult time making sense of these data. What code are you using to analyse them?
In the Excel table, the time values do not match. If the output is sampled at the same times as the input, they should match. Also, while the two ‘Input’ values appear the same in the plots, the magnitudes differ by a factor of about 3E+3. The times in the Excel file are also not regularly sampled, and the sampling frequencies are not equal. I understand that there appears to be a delay in the system being measured, hoiwever the sampling times should be the same regardless.
Please resolve these issues, since I cannot work with these data until they are resolved. That they are not may actually be the problem here.
format long
M1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1298570/Input.txt')
% C1 = readcell('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1298600/Input%20&%20Output.xlsx')
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1298600/Input%20&%20Output.xlsx','VariableNamingRule','preserve')
T1{:,1} = T1{:,1}*1E-3; % Convert To seconds
Input = rmmissing(T1{:,[5 6]})
FsInput = mean(1./diff(Input(:,1)))
FsdInput = std(1./diff(Input(:,1)))
FsOutput = mean(1./diff(T1{:,1}))
FsdOutput = std(1./diff(T1{:,1}))
figure
plot(M1(:,1), M1(:,2))
grid
figure
subplot(2,1,1)
plot(T1{:,1}, T1{:,2})
grid
title('Output')
subplot(2,1,2)
plot(Input(:,1), Input(:,2))
grid
title('Input')
figure
subplot(2,1,1)
plot(T1{:,1}, T1{:,2})
grid
xlim([0 20])
title('Output')
subplot(2,1,2)
plot(Input(:,1), Input(:,2))
grid
xlim([0 20])
title('Input')
.
Categorie
Scopri di più su Plot Customization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


