필터 지우기
필터 지우기

Simulation of a non-parametric model

조회 수: 3 (최근 30일)
SKRE
SKRE 2021년 11월 8일
답변: Shreshth 2024년 7월 10일 6:02
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
Shreshth 2024년 7월 10일 6:02
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.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by