Code covered by the BSD License  

Highlights from
swept_sine

Be the first to rate this file! 20 Downloads (last 30 days) File Size: 1.62 KB File ID: #24987
image thumbnail

swept_sine

by michael arant

 

10 Aug 2009 (Updated 16 Aug 2009)

Swept sine generation program that maintains signal quality over entire frequency range

| Watch this File

File Information
Description

Common swept sine (or cosine) generation functions use a linear time vector with an increasing frequency rate. This results in the higher frequency content range having fewer points per cycle which reduces the quality of the swept sine at higher frequencies. The most common solution to this problem is to make the time increment smaller thus increasing the number of points in the higher frequency content at the expense of a significant increases in vector size and numerical computation time.

A second and less common solution is to use an exponential time increment to place more of the time increment points in the higher frequency domain where they are needed. However, these methods are not trivial to define and usually result in inconsistent numbers of points per cycle. Non-linear time methods need to have the time increment rate matched with the frequency range AND the number of cycles contained in the sine function to produce a progressive increase in the frequency rate and maintain a consistent number of point on the curve per cycle.

The following swept sine function avoids the compromises of the above solutions by generating a constant sine function and a swept time function. The result is a swept sine function that contains a consistent number of points per cycle, has a linear sweep rate, and permits the user to define the total number of cycles in the signal. The inputs to the model are the initial and final frequencies, the number of cycles in the sweep function, and the number of points per cycle.

The attached image shows the swept sine function (top), the more typical Chirp function in the middle, and a typical exponential time plot at the bottom. All were evaluated over 0.1 to 10 Hz. Note that the signal content of the swept sine function is significantly better at higher frequencies and that the swept_sine function contains fewer points in the lower frequencies where the fidelity requirements are lower.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
16 Aug 2009

Transpose time vector to same orientation as the sine function

Tag Activity for this File
Tag Applied By Date/Time
control design michael arant 11 Aug 2009 11:40:39
mathematics michael arant 11 Aug 2009 11:40:39
measurement michael arant 11 Aug 2009 11:40:39
signal processing michael arant 11 Aug 2009 11:40:39
simulation michael arant 11 Aug 2009 11:40:39

Contact us at files@mathworks.com