A plot of 'f' (frequency) versus 't' (time) in Matlab for non-linear frequency modulated signal

2 views (last 30 days)
I have the mathematical equation for time- frequency relationship as below:
t = Tp.*(f/Bp + (1/(2*pi).* sin((2*pi*f)./Bp)));
where Bp is the Bandwidth, Tp is the pulse duration.
Can anybody help me to write this equation in terms of f. I want to use the f to compute the phase and the signal as :
phase = 2*pi* cumsum(f).* dt;
where dt is the sampling interval of the pulse duration defined as Tp/Ns, (Ns= number of samples in the pulse of duration- Tp)
I tried to use 'solve' function in Matlab, but its not successful. kindly suggest if there is a method to invert the above mentioned equation in terms of f.
thank you :)

Answers (1)

NVSL
NVSL on 23 Jan 2025
Edited: NVSL on 23 Jan 2025
I can see you are trying to use “solve” function to solve a non-linear complex function. The “solve” function has its limitations when it comes to solving complex equations. You can alternately try out fsolvethat approximates "f" from an expected initial point f0 that can be defined based on the time, bandwidth and pulse duration. I have added a sample code that can provide an idea how to use the “fsolve” function. You can then use the computed "f" to find the phase.
% Given variables
Tp = 1; % Example value for Tp
Bp = 2; % Example value for Bp
t = 1; % Example value for t
% Define the function handle - target 'f'
fun = @(f) Tp * (f/Bp + (1/(2*pi)) * sin((2*pi*f)/Bp)) - t;
% Initial guess
f0 = 0.1; % Initial guess for f, adjust based on expected range
% Solve the equation
options = optimoptions('fsolve', 'Display', 'iter'); % Display iteration information
[f_solution, fval, exitflag] = fsolve(fun, f0, options);
Norm of First-order Trust-region Iteration Func-count ||f(x)||^2 step optimality radius 0 2 0.811474 0.879 1 1 4 0.249989 0.923416 0.000676 1 2 6 0.000547816 1 0.0234 1 3 8 4.46774e-10 0.0234372 2.11e-05 2.5 4 10 2.60817e-29 2.1137e-05 5.11e-15 2.5 Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
% Display the result
if exitflag > 0
fprintf('The solution is f = %.4f\n', f_solution);
else
fprintf('fsolve did not converge\n');
end
The solution is f = 2.0000
You can find the documentation of “fsolve” here
https://www.mathworks.com/help/optim/ug/fsolve.html

Categories

Find more on Get Started with MATLAB 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!