Below is a simple matlab code that generates a sinusoidal signal with user specified no of cycles. How do i change this such that each cycle has different instantaneous frequency? For example, if i have 10 cycles, then there should be 10 random frequencies in total where each cycle has different frequency.
clcclearf1=120;fs=f1/60; %sampling frequency depends on f1
no_of_cycles=10;f=no_of_cycles/60; %Frequency of sinusoid
duration=1;%%duration of the sinusoidal signal in minutes
A=1;t=1/fs:1/fs:duration*no_of_cycles*1/f; %time index
y1=A*sin(2*pi*f*t);%%simulated sinusoidal signal
Best Answer