Suddenly Moving Signals
Another fundamental signal to look at is the
impulse
. We don’t call it an
“impulse wave,” because technically it’s not a wave. Like noise it is not peri-
odic, but unlike noise, which is a continuous signal, an impulse exists for just a
moment in time. If we set only one sample in the stream to 1
.
0 while all the rest
138
Digital Signals
are zero we get a very short and rather quiet click. It sounds a bit like the step
impulse we first heard as a signal change between 0
.
0 and 1
.
0, but this kind
of impulse is a single sample of 1
.
0 that returns immediately to 0
.
0. The time
domain graph and spectrum snapshot are shown in figure 7.15. The code sets
a single bit to 1
.
0 (in this case in the middle of the graph to make it easier to
see) and all previous and subsequent bits to zero. This is sometimes called the
Kronecker delta function
.
f l o a t
b l o c k [ 6 4 ] ;
i n t
sample ;
i n t
t i m e = 0 ;
while
( 1 )
{
f i l l b l o c k ( ) ;
}
void
f i l l b l o c k ( )
{
sa mple = 6 3 ;
while
( sample
−−
)
{
i f
( t i m e == 5 1 2 )
{
b l o c k [ sa mple ] = 1 . 0 ;
}
e l s e
{
b l o c k [ sa mple ] = 0 . 0 ;
}
t i m e++;
}
}
Impulses behave a bit like noise by trying to fill up the entire spectrum with fre-
quencies. Again, they are a mathematical abstraction, and real impulses do not
behave exactly as their theoretical models. They are revealing tools, or analyt-
ical things for the most part, but they are very useful in sonic construction.
But here’s a riddle. How can all the frequencies happen at once in time? That’s
impossible. Frequency is about changes in time, and if time diminishes to zero
then surely there can be
no
frequencies? Well, this isn’t a book about wave
mechanics, so let’s not go too deeply into uncertainty principles, but you may
have realised that the more we know about the precise position of a signal in
space-time the less we know about its frequency, and vice versa. In reality the
frequencies
appear
to be there because of the sharpness of an impulse.
In the spectrum graph you can see the frequencies the impulse occupies.
Actually this is partly an artefact of the measuring process, the Fourier algo-
rithm, but that’s good because it shows us that the theory of impulses as packets
of “all frequencies” is consistent with itself and other parts of DSP theory. The
dark band is the average level of the graph; if we could measure the average of
all the frequencies in a set of perfect impulses it would be a straight line in this
dark area, showing an equal representation for all frequencies. But the best way
Do'stlaringiz bilan baham: |