Methods for Tone and Signal Synthesis - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Methods for Tone and Signal Synthesis

Description:

Warning and notification tones. Music synthesis. ECEN4002 Spring 2002 ... Most Western music uses a 'Well-Tempered Scale' for the 12 notes of the diatonic ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 20
Provided by: RobMa59
Category:

less

Transcript and Presenter's Notes

Title: Methods for Tone and Signal Synthesis


1
Methods for Tone and Signal Synthesis
  • R.C. Maher
  • ECEN4002/5002 DSP Laboratory
  • Spring 2002

2
Signal Synthesis
  • So far in this course, we have considered signal
    processing input signal sent through LTI system
  • For signal synthesis, we generally do not have an
    explicit input signal output is generated by an
    algorithm

3
Applications of Synthesis
  • Synthesis is useful in DSP systems for
  • Communications signals (modulation, coherent
    detection, modem tones, etc.)
  • Test signals (function generator, noise test
    signals, transfer function measurement)
  • Warning and notification tones
  • Music synthesis

4
General Synthesis Types
  • Algorithmic synthesis
  • Pseudo-random signals (noise with specified
    statistical properties)
  • Periodic signals using a mathematical formula
    (transcendental functions, discrete summation)
  • Look-up table synthesis
  • Signal synthesized by reproducing samples from
    data in memory a wavetable

5
Random Signal Generation
  • Want an algorithm to produce a sequence of
    numbers that appear to be chosen randomly
  • Usually use a periodic sequence with a period
    sufficiently long that the repetition is not a
    problem sequence is pseudo-random
  • Method applicable to DSP chips is the linear
    congruential algorithm

6
Linear Congruential Method
  • A cheap and not particularly rigorous method to
    make pseudo-random sequences
  • Uses a recursive method and a modulo
  • For numbers between 0 ? y ? (M-1), select y0
    (seed) and values for multiplier a,
    displacement c, and modulus M. Not all choices
    give maximal-length sequence!!
  • yn(ayn-1 c)mod M

7
Periodic Signal Algorithm
  • Generate the signal by implementing a
    discrete-time formula
  • Works well for square, pulse, triangle, sawtooth
    waveforms, but these are generally not
    bandlimited
  • If sufficient processing power available, can
    approximate an arbitrary function (cosine,
    exponential, etc.)

8
Digital Sinusoid Generator
  • Consider a filter with hnRn sin(w0n) u(n),
    which is a causal decaying sinusoid for 0ltRlt1,
    and a pure sinusoid for R1
  • w02pf/fs
  • Start with impulse input

9
Stored Signal Synthesis
  • Concept fill a delay line with one cycle of the
    desired waveform, then loop the signal over and
    over to produce the extended output signal
  • Vary the frequency by decimation / interpolation
    of the stored samples
  • Vary the amplitude by multiplying a slowly
    varying envelope function

10
Wavetable Frequency Control
  • Assume table is length N, holds one period of the
    signal, and the sample rate is fs
  • Output frequency for entire table is fs/N

New sample every 1/fs Table frequency fs/N
Wavetable (N)
11
Frequency Control (cont.)
  • To get a different output frequency from the same
    stored wavetable, define a sample increment (SI)
    and a lookup accumulator (LUA).
  • SI is typically a fixed-point number (integer
    part and fractional part) defined by

12
Frequency Control (cont.)
  • Lookup accumulator (LUA) has an integer part and
    a fractional part. The integer part is modulo-N
    counts zero to N-1, then rolls over to zero.
  • At each sample time, add SI to LUA, then use
    integer part of LUA as lookup index into stored
    wavetable. Can use fractional part of LUA for
    inter-sample interpolation

13
Wavetable Lookup Example
  • fs48000 Hz, N1024, desired fout440 Hz
  • SI1024?440 / 48000 9.386667

14
Implementation on DSP
  • Load a buffer with one cycle (length N) of the
    waveform
  • Define SIinteger and SIfraction variables
  • Define LUAinteger and LUAfraction variables
  • For each sample
  • Add SIfractional to LUAfractional
  • Add with carry SIinteger to LUAinteger
  • If LUA?N, subtract N from LUAinteger
  • Fetch wavetable sample at offset LUAinteger

15
Details to watch out for
  • Wavetable lookup (resampling) with SIgt1 will
    cause aliasing if wavetable contains components
    above fs/(2SI)
  • Choosing N to be a power-of-2 makes LUA modulo a
    simple masking operation
  • Frequency resolution determined by number of
    fractional bits in LUA

16
Linear Interpolation
  • LUA contains desired location of next output
    sample. If LUAfraction ? 0, we need to
    interpolate the table.
  • Ideally, need to do bandlimited (Shannon)
    interpolation, but often settle for cheap linear
    interpolation between adjacent table samples

yL1
yL
L
L1
L fract
17
Basic Wavetable Synthesizer
Wavetable
Gain Multiplier
Sample Increment (SI)
Envelope
18
Musical Frequency Scale
  • Most Western music uses a Well-Tempered Scale
    for the 12 notes of the diatonic scale
  • Scale based on note A 440 Hz
  • All other A note frequencies are multiples of 2n,
    where n is an integer (A110, 220, etc.)
  • Other notes (B, B, C, etc.) related by 2k/12
  • Factor 21/12 1.059463

19
Musical Scale (cont.)
  • Example for A4440 Hz, N1024, fs48000
Write a Comment
User Comments (0)
About PowerShow.com