Is it possible that ploting bode diagram without transfer fuction?
26 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
Is it possible that ploting bode diagram without transfer fuction?
I have some values of the Power and the Speed as inputs and some output values in excel format. However the transfer fuction of the system has not been defined.
Are there any one who knows any method or code to plotting bode diagram without transfer function?
0 个评论
采纳的回答
Star Strider
2019-12-16
input = randn(1, 10000);
output = randn(1, 10000);
time = linspace(0, 1000, 10000);
Fs = 100; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = numel(time);
FTinp = fft(input)/L;
FTout = fft(output)/L;
TF = FTout ./ FTinp; % Transfer Function
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
subplot(2,1,1)
plot(Fv, 20*log10(abs(TF(Iv))))
title('Amplitude')
ylabel('dB')
subplot(2,1,2)
plot(Fv, angle(TF(Iv))*180/pi)
title('Phase')
ylabel('°')
Provide your own vectors for ‘input’, ‘output’, and ‘time’.
2 个评论
Heng Jiang
2024-7-5
Hello, could you please tell me that, if the input is a sine wave with changing frequencies, like: input = 10*sin(2*pi*w.*time), w = linspace(0, 100, 10000), how should I modify the Frequency vector? Should Fv be replaced with w?
Star Strider
2024-7-5
That would appear to be a linear chirp sort of input. I doubt that the code would change much (if at all), since the chirp input woud likely be similar to an impulse input in that it covers a wide band of frequencies. It might be wortth exploring the input and output separately with one of the spectrogram plots (specttrogram or pspectrum). Otherwise, do tthat experiment yourself and see what the result is.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!