Find phase plot between input and output experimental data?

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

@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.
(Answers Dev) Restored edit

Accedi per commentare.

Risposte (1)

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')
M1 = 10000×2
1.0e+04 * 0 1.553700000000000 0.000001017600000 1.556800000000000 0.000002032100000 1.559900000000000 0.000003046700000 1.563000000000000 0.000004054400000 1.566100000000000 0.000005067100000 1.569100000000000 0.000006080600000 1.572100000000000 0.000007095300000 1.574900000000000 0.000008106300000 1.577700000000000 0.000009120600000 1.580400000000000
% 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 = 104459×6 table
Time (ms) output (mm0 Var3 Var4 Time (s) Input (mm) _________ ________________ ____ ____ ________ ________________ 0 3.45833579783243 NaN NaN 0 4.9988037109375 70 3.45836061885825 NaN NaN 0.010176 5.094921875 71 3.45484844370411 NaN NaN 0.020321 5.1910400390625 72 3.46016014323052 NaN NaN 0.030467 5.287158203125 73 3.46260501427422 NaN NaN 0.040544 5.3832763671875 74 3.4565735049989 NaN NaN 0.050671 5.4762939453125 75 3.46016014323052 NaN NaN 0.060806 5.5693115234375 76 3.45991193297228 NaN NaN 0.070953 5.6561279296875 77 3.45600262140494 NaN NaN 0.081063 5.74294433593749 78 3.4500455752071 NaN NaN 0.091206 5.82666015625 79 3.45757875654478 NaN NaN 0.101351 5.907275390625 80 3.45998639604975 NaN NaN 0.111499 5.9847900390625 81 3.45499736985906 NaN NaN 0.121622 6.0592041015625 82 3.46120262631514 NaN NaN 0.131774 6.1274169921875 83 3.46097923708273 NaN NaN 0.141848 6.19252929687499 84 3.45719403064451 NaN NaN 0.15197 6.2514404296875
T1{:,1} = T1{:,1}*1E-3; % Convert To seconds
Input = rmmissing(T1{:,[5 6]})
Input = 10000×2
0 4.998803710937501 0.010176000000000 5.094921874999997 0.020321000000000 5.191040039062500 0.030467000000000 5.287158203124996 0.040544000000000 5.383276367187499 0.050671000000000 5.476293945312499 0.060806000000000 5.569311523437499 0.070953000000000 5.656127929687500 0.081063000000000 5.742944335937494 0.091206000000000 5.826660156250000
FsInput = mean(1./diff(Input(:,1)))
FsInput =
98.755138173019446
FsdInput = std(1./diff(Input(:,1)))
FsdInput =
0.306849580474746
FsOutput = mean(1./diff(T1{:,1}))
FsOutput =
9.999809903091644e+02
FsdOutput = std(1./diff(T1{:,1}))
FsdOutput =
3.753404440191707
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')
.

Accedi per commentare.

Richiesto:

il 11 Feb 2023

Commentato:

il 9 Mar 2023

Community Treasure Hunt

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

Start Hunting!

Translated by