0% found this document useful (0 votes)
149 views6 pages

Generation of Shepard Tone Tutorial

The document describes how to generate a Shepard tone in MATLAB. A Shepard tone is a sound that consists of a superposition of sine waves separated by octaves, creating the auditory illusion of a tone that seems to continually ascend or descend in pitch without getting higher or lower. The algorithm uses chirp functions to generate the sine waves at different frequencies separated by octaves. It allows the user to choose the sampling frequency, number of harmonics, and whether the tone ascends or descends in pitch. The procedure outlines the steps to define variables, generate the harmonic frequencies, attenuate frequencies, set gradients/amplitudes/envelopes, and play the sound.

Uploaded by

Haris Ghafoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
149 views6 pages

Generation of Shepard Tone Tutorial

The document describes how to generate a Shepard tone in MATLAB. A Shepard tone is a sound that consists of a superposition of sine waves separated by octaves, creating the auditory illusion of a tone that seems to continually ascend or descend in pitch without getting higher or lower. The algorithm uses chirp functions to generate the sine waves at different frequencies separated by octaves. It allows the user to choose the sampling frequency, number of harmonics, and whether the tone ascends or descends in pitch. The procedure outlines the steps to define variables, generate the harmonic frequencies, attenuate frequencies, set gradients/amplitudes/envelopes, and play the sound.

Uploaded by

Haris Ghafoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Generation of Shepard Tone in

MATLAB
By:
Introduction
• A Shepard tone, named after Roger
Shepard, is a sound consisting of
a superposition of sine waves separated
by octaves.
• When played with the bass pitch of the
tone moving upward or downward, it is
referred to as the Shepard scale.
• This creates the auditory illusion of a tone
that seems to continually ascend or
descend in pitch, yet which ultimately gets
no higher or lower.
Algorithm
• We know that it’s the combination of sines
and cosines of different frequencies.
• And our requirement is to create a sound
whose pitch moves upwards or downwards.
• Our design code will give freedom to
choose the sampling frequency and the
number of harmonics of the tone.
Procedure (1/3):
 Step 1:
• To find the maximum frequency range and No of samples

• Defining variables for attenuation, Envelope and the gradient of the


sound
• Create the Harmonic frequency as it is essential part of the Code

Where n is the number of harmonics.


• Use function ‘chirp’ and according to Mathworks:
y = chirp(t,f0,t1,f1) generates samples of a linear swept-frequency
cosine signal at the time instances defined in array t, where f0 is the
instantaneous frequency at time 0, and f1 is the instantaneous
frequency at time t1. f0 and f1 are both in hertz. If unspecified, f0 is e-
6
 for logarithmic chirp and 0 for all other methods,t1 is 1, and f1 is 100.
Procedure (2/3):
 
Step 2:
• Now we need to attenuate all the frequency
which is less than the fnote which is actually
the given frequency by the user.
• So now we have to set the gradients,
amplitudes, fade outs and other parameters
for two cases: for 1st harmonic

• And when
Procedure (3/3):
Step 3:
• We need to give the users a choice
whether they want an ascending pitch or
descending pitch. For this, we will set an
input parameter and will use the flip
command.
• Now we need to set the envelope level,
plot settings and soundplay settings using
the multiple functions.

You might also like