Simulation of a non-parametric model

5 visualizaciones (últimos 30 días)
SKRE
SKRE el 8 de Nov. de 2021
Respondida: Shreshth el 10 de Jul. de 2024
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.

Respuestas (1)

Shreshth
Shreshth el 10 de Jul. de 2024
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.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by