Clear Filters
Clear Filters

Simulation of a non-parametric model

3 views (last 30 days)
SKRE
SKRE on 8 Nov 2021
Answered: Shreshth on 10 Jul 2024 at 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.

Answers (1)

Shreshth
Shreshth on 10 Jul 2024 at 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.

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!