Simulation of a non-parametric model
이전 댓글 표시
Hello,
as a result of a measurement I have the amplitude and the phase shift for a system for special frequencies.
Now I would like to build a simulation in Simulink with this point-wise transfer function (e.g. with a linear interpolation between the points).
What is the best way to do this?
My thoughts went in the direction of fitting a parametric transfer function to the nonparametric or Fourier transform of the input signal, but the latter variant seems to me to be difficult, at least for a priori unknown signal characteristics.
I would be very grateful for hints on more elegant solutions.
답변 (1개)
Shreshth
2024년 7월 10일
Hey SKRE,
Creating a simulation in Simulink using point-wise transfer function data can indeed be challenging but is certainly doable. Here are some steps and considerations that might help you achieve your goal.
- Prepare Data:Organize your frequencies, amplitudes, and phase shifts.
- Create Interpolation Functions in MATLAB:
amp_interp = @(f) interp1(freq, amplitude, f, 'linear');
phase_interp = @(f) interp1(freq, phase, f, 'linear');
- Implement MATLAB Function Block in Simulink: Add a MATLAB Function block with the following code
function y = pointwise_transfer_function(u, freq)
% Define interpolation functions
amp_interp = @(f) interp1(freq, amplitude, f, 'linear');
phase_interp = @(f) interp1(freq, phase, f, 'linear');
% Interpolate amplitude and phase
amplitude = amp_interp(freq);
phase_shift = phase_interp(freq);
% Apply transfer function
y = amplitude * u * exp(1i * phase_shift);
end
- Connect Blocks:Connect your input signal to the MATLAB Function block.
- Connect the output to a Scope for visualization.
- Test and Validate.
Hope it helps.
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!