Trying to make a chirp (sweep) in matlab with random frequency

C
Christian · Jan 25, 2021 · 1.9K views
Question
Hi guys!   I have been trying to make a chirp function in which the frequency is changing randomly through the time   my parameters are this t1=0 t2=1 f1=0 f2=60   I have tried the chirp function of matlab, however, the frequency is linearly increasing but I also want that it could decrease.   Any ideas?   Thanks in advance
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Aug 21, 2026

It's not really a chirp if you want to have the frequencies vary more or less randomly up and down. But anyway, to make a  signal with random frequencies:

 

t = linspace(0, 100, 400);
amplitude = 3;
% Make random frequencies.
frequency = .04 + .04 * rand(1, length(t));
% Construct waveform.
y = amplitude * cos(2 .* pi .* frequency .* t);
plot(t, y, 'b-');
grid on;
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0, 0, 1, 1]);
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!