Sie sind auf Seite 1von 10

Digital Signal Processor (DSP) based 1/f noise generator

R. Mingesz, P. Bara, Z. Gingl and P. Makra

Department of Experimental Physics, University of Szeged, Hungary


Dom ter 9., Szeged, H-6720 Hungary
Keywords: 1/f noise, noise generator, DSP, digital filter

ABSTRACT

1/f noise is present in several natural and artificial systems, and even though it was discovered several years ago, it is
still not completely understood. Due to the lack of an universal model, the main methods of investigating a system
where 1/f noise is present are numerical simulations and real measurements. The second method can lead to more
adequate results, since it is free from numerical artifacts. In the case of real measurements, we need reliable, wide-band
noise generators. Many ways of generating noise are known; most of them have several limitations on the frequency
bandwidth or on spectral properties. We wanted to create a device which is easy to use, which can generate any kind of
1/f noise and whose bandwidth is wide enough to make our investigations. We used a DSP (ADSP2181) to
numerically generate the desired noise, and a D/A converter to convert it to an analogue signal. The noise generation
algorithm was based on the known method of filtering a Gaussian white noise with a series of first-order digital filters.
We enhanced this method to get a better spectral shape and to compensate for the side effects of the digital-to-analogue
conversion.

1. INTRODUCTION

High-performance and reliable noise generators are useful to aid system analysis, system simulation, exploring time and
frequency structure of different kinds of noises and many more.
Nowadays computer simulation is a widely used and accepted method to generate, use and analyse noise, since
sophisticated random generation and other algorithms are available. However, in real world applications it is often
necessary to have an analogue noise source, like in system analysis and when the experiment has real components
requiring analogue input signals. Furthermore, the limited performance of numerical methods may degrade speed and
accuracy, therefore noise generators with analogue output have many potential applications.
There are many ways to realise noise generators. It is quite easy and straightforward to design a white noise generator
with flat spectrum, however realising a high-performance, wide frequency range 1/f noise source is still a challenge,
mainly due to the absence of a simple generation method. There are many ways to make a 1/f noise generator [1-3].
One may use a real physical process, like semiconductor (e.g. MOSFET) noise, may apply cascaded or paralleled
analogue filters to white noise or use the so-called mixed signal design (both analogue and digital), where a digital
computer is used to make a pseudo-random sequence and a precision digital-to-analogue converter provides a real
analogue signal. All methods have some drawbacks, like limited frequency range, absence of easily scaled frequency
range and even more probably the impossibility of easy setting of the desired power exponent . Digital methods have
many advantages to address these points, but a general-purpose computer although it may be very fast - is not
optimised for real-world applications, since it may be loaded by unpredictable network traffic, background processing,
etc. A very efficient solution is the use of a special-purpose digital signal processor (DSP) [3], which has very accurate
timing and an extremely efficient processing core. Advanced DSPs and development tools are widely available;
therefore it is quite reasonable to use a DSP to build an efficient and flexible noise generator. In this paper we show a
realisation of a 1/f noise source based on a fixed-point ADSP-2181 DSP microcomputer [4]. Our design incorporates a
precision digital-to-analogue converter and an easily configurable software to aid simple setting of the frequency range
and the exponent . The noise generator is capable of providing accurate 1/f noise over more than four decades of
frequency, allows manual or host computer (typically PC) controlled setting of parameters via its standard serial
interface.
2. 1/f NOISE GENERATION USING DIGITAL FILTERS

Digital filters model analogue filters and have very similar characteristics, only digital filters are used to transform data
sequences that are discrete in time. For a discrete data sequence xi , the output of a digital filter is given by Eq. 1.
R

C yi = D1 xi + D0 xi 1 C 0 yi 1 (1)
1
1

0.1

Amplitude [au]
Amplitude [au]

0.1

0.01

0.01
1E-3

Fm/2
1E-4
0.01 0.1 1 10 100 0.01 0.1 1 10 100 1000
Frequency [Hz]
Frequency [Hz]
Fig. 1. Analogue filter versus digital filter. On the right panel, we can see the realisation and the transfer
characteristics of an analogue low-pass filter, while the left panel shows the same for the corresponding digital
filter. The curves come from theoretical calculations; the sampling frequency is 1000 Hz.

The operation of the analogue and digital filters can be linked through the Bilinear Z transformation. Without going into
too much detail, we should like to note that since the operation range of the digital filter is limited to the 0f<fs/2
frequency interval (as it follows from the sampling theorem), we can obtain the transfer function of the digital filter
from the transfer function of its analogue counterpart by projecting the whole frequency axis onto the 0f<fs/2 frequency
interval, and substituting a transformed frequency into the analogue transfer function. The frequency transformation is
given by
fs f
f '= tg (2)
fs
where fs denotes the sampling frequency. If f fs, f . This way, the transfer function of the digital filter proceeds
as
1 fs f0
a( f ) = , f0 ' = tg (3)
1+ i
f' fs
f0 '
wherein f0 is the cut-off frequency of the digital filter. The parameters of a first-order digital filter with a cut-off
frequency f0 and amplitude A0 are
1 l A
C0 = , D0 = D1 = 0 (4)
1+ l 1+ l
f
where: l = ctg , s = s (5)
s f0
where s is a normalised sampling frequency. These parameters pertain to Eq. 1. We should like to note here that while
digital signals are considered, the sampling frequency plays no role; only the ratio of the frequencies is important. The
concrete values of the sampling frequency and the cut-off frequencies of the filters come to the fore only when we
consider a sampled signal, or a signal converted from the digital into the analogue domain.
If we pass the signal coming from a white noise source (random generator) through a first-order low-pass filter, we get a
Lorentzian noise. If we arrange filters whose cut-off frequencies are equally spaced on a logarithmic scale and whose
amplitude (A0) is proportional to 1/f 0.5 in parallel, we obtain 1/f noise. Analogously, we can produce 1/f noise if the
amplitude of the filters is proportional to 1/f /2.

A1, f1
White
noise A2, f3 +
1/f
noise
A3, f3
.
.
.
Fig. 2. 1/f noise generator realised by means of first-order filters.

10

1/f
Amplitude [au]

0.1

0.01
1E-3 0.01 0.1 1 10 100
Frequency [Hz]

Fig. 3. A filter with a transfer function of 1/f power rule.

3. PROBLEMS AND SOLUTIONS

The filters are somewhat distanced from each other, which introduces undulation into the transfer function. It is the
distance of the filters that determines the extent of this undulation: the closer they are to each other, the weaker the
undulation is. On the other hand, if we use too many filters, the calculation load will increase. On the basis of our
experiments, it is possible to reach an undulation weaker than 1 per cent with 1.5-2 filters per decade.
Digital-to-analogue conversion modifies the spectrum of the output signals. This is because D/A converters produce
step functions instead of Dirac impulses at their output. Consequently, the spectrum of the output is weighted by a
sin(x)/x function.
1
Amplitude [au]

0.1

0.01

fs
1E-3
1 10 100 1000

Frequency [Hz]

sin( f / f s )
Fig. 4. The weight function.
f / fs
At a frequency that is small compared to the sampling frequency the influence of this weight function is negligible, but
if we want to exploit the full frequency range with the upper cut-off frequency of our noise, we have to take this effect
into consideration. As an illustration, we note that at one tenth of the sampling frequency this effect makes a
contribution of 1.5 per cent.
Due to the frequency transformation there is a sharp cut-off around fs/2, but again, this effect is significant only when we
want to exploit the full frequency range given by the sampling frequency.

0.1

Amplitude [au]
0.01
fs/2
Effect of
1E-3 frequency transformation

1E-4
0.01 0.1 1 10 100 1000
Frequency [Hz]

Fig. 5. The sharp cut-off due to the frequency transformation around fs/2.

We can visualise the deviations from the 1/f power rule better if we multiply the amplitude transfer function by the
square root of f (the 1/f power rule applies to the power spectral density, which is proportional to the square of the
amplitude spectrum, thus the amplitude spectrum must conform to a 1/f 0.5 power rule). In the ideal case, this should
yield a line on the logarithmic scale. Of course, if we want to obtain an 1/f noise in general, we must multiply the
amplitude spectrum by 1/f /2.
1.5
10
[au]
Amplitude [au]

1 1.0
0.5
Amplitude * f

0.1
0.5
X1

0.01 X2
0.0 X3
1E-4 1E-3 0.01 0.1 1 10 100
1E-4 1E-3 0.01 0.1 1 10 100
Frequency [Hz]
Frequency [Hz]
Fig. 6. Multiplying the amplitude transfer function by the square root of f, we can see that in the case of the first and the last filter, the
transfer differs significantly from what is desirable. The curves are based on theoretical calculations, fs=1000 Hz, and there is one
filter per decade.

In Fig. 6 we can see that the deviation from the ideal power rule is rather large. This significant deviation in the transfer
function is caused by the fact that the filters at the beginning and at the end of the filter chain are in an asymmetric
position. On the basis of Fig. 6, we can easily understand the implications of this. The transfer function is the complex
sum of the individual transfer functions of the filters in parallel. This way, the transfer at the cut-off frequency of the
first filter is given by
a1 ( f1 ) X 1 + X 2 + X 3 + ... (6)
where X1=a1(f1), X2=a1(f2) and X3=a1(f3) (see Fig. 6), a1(f) is the amplitude transfer function of the first filter, and f1, f2
and f3 are the cut-off frequencies of the first, second and third filters, respectively. At the cut-off frequency of the second
filter, it is
a1 ( f 2 ) X 1 + 2 X 2 + X 3 + ... (7)
while at the cut-off of the third (middle) filter it is
a1 ( f 3 ) X 1 + 2 X 2 + 2 X 3 (8)
We see that the transfer function is largest at the middle filter, while in the case of the filters at the sides the amplitude is
reduced significantly. To compensate for this effect, we should increase the amplitude transfer of the filters at the sides
(additionally, we may also mind the other effects mentioned above). The problem is that modifying the transfer function
of an individual filter will affect the whole transfer function, thus it is difficult to find the appropriate coefficients. Our
experiments show that it is possible to reach an accuracy of few per cent only modifying the amplitude transfer of the
filters at the sides. If we want to be more accurate, we may modify the transfer of the other filters, albeit to a relatively
small extent. The degree of compensation depends on the density of filters per decade and on the spectral exponent of
the desired noise. In the case of 1/f noise, the modifications in the filters must be nearly symmetric (of course, if we take
into account the sin(x)/x weight and the effects of the frequency transformation, this symmetry no longer applies: the
amplitude transfer of the filter with the largest cut-off frequency must be increased to a larger extent than that of the
others. We can see the effects of this modification in Fig. 7; the amplitude transfer of the two filters at the sides we
multiplied by 1.42. The undulation is due to the fact that there is only one filter per decade.
1.5
[au]

1.0
0.5
Amplitude * f

0.5

0.0
1E-4 1E-3 0.01 0.1 1 10 100
Frequency [Hz]

Fig. 7. Modifying the amplitude of the first and the last filters,
the transfer characteristic is closer to the desired shape.

Our aim was to create an analogue output noise generator that is able to produce noises with 1/f -shaped power spectral
density over four decades. In the following we will optimise the arrangement and amplitude of the filters for this device.
Of course, if we use this noise generation method in numerical simulations, we have more freedom in choosing the
number and location of the filters.
We placed nine filters in the frequency range of 4.8610-3Hz and 400Hz, at the sampling frequency of 1000Hz. Then we
optimised the amplitude of the filters. The result is illustrated in Fig. 8. The reason for choosing this frequency range we
shall explain in the next section. As long as the generated noise is used only in simulations and it is not linked to real
processes, it is only the ratio of these frequencies that matters.

2.5 2.35
[au]

2.0
[au]

2.30
0.5
Amplitude * f

1.5
0.5
Amplitude * f

2.25
1.0

2.20
0.5

0.0 2.15
1E-4 1E-3 0.01 0.1 1 10 100 1E-4 1E-3 0.01 0.1 1 10 100
Frequency [Hz] Frequency [Hz]

Fig. 8. The transfer characteristic of the nine combined filters.


On the right we can see that its undulation is within 1%.
The filters amplitudes are modified by 1.71, 1.06, 1.021, 1, 1, 1, 1, 1.086 and 1.8 respectively.
The power spectral density and the distribution of the noise generated using this filter is visible in Fig. 9. According to
simulation the power spectral density is rather accurately 1/f-shaped over the range of four decades, and it has a
Gaussian distribution. (The parameters of the simulation: the sample length is 211 samples, probability densities are
calculated from the average of 100 individual simulations and the sampling frequency is 1000Hz.)

1E-3
0.04
1E-4
Power spectrum [au]

1E-5 1/f 0.03

Probability
1E-6
0.02
1E-7

1E-8 0.01

1E-9
0.00
1E-10 -1.0 -0.5 0.0 0.5 1.0
1E-3 0.01 0.1 1 10 100
Frequency [Hz] X

Fig. 9. The spectrum and the time-domain distribution of the 1/f noise generator realised by digital filters.

If we would like to generate 1/f instead of 1/f noise, the amplitude of the filters should be modified asymmetrically.
The filter characteristics for 1/f 0.5 and 1/f 1.5 noises are shown in Figs. 10 and 11.
3.5

3.0
[au]

2.5
0.75

2.0
Amplitude * f

1.5

1.0

0.5

0.0
1E-4 1E-3 0.01 0.1 1 10 100
Frequency

Fig. 10. Filter configuration for 1/f 1.5 noise.


The amplitudes of the filters are modified by 3.137, 1.076, 1.037, 1, 1, 1, 0.986, 1 and 1.839 respectively.

3.5

3.0
[au]

2.5
0.25

2.0
Amplitude * f

1.5

1.0

0.5

0.0
1E-4 1E-3 0.01 0.1 1 10 100
Frequency [Hz]

Fig. 11. Filter configuration for 1/f 0.5 noise.


The amplitudes of the filters are modified by 1.331, 1.01, 1.04, 1, 1, 1, 1.01, 1.02 and 3.3 respectively.
If we would like to generate noise with arbitrary spectral exponent, it is difficult to optimise the amplitude of all filters
for each spectral exponent. But we can have satisfying results (within an error of 1-1.5 per cent) if we modify only the
first and the last filter. If we modify only these two filters, increasing the number of the filters will reduce the undulation
of the transfer characteristic, but the deviation from the ideal characteristic will increase at the sides of the frequency
range. Over two filters per decade, we have to modify more filters to get acceptable results.
Using numerical simulations, we get the best multiplying parameters for noises with an exponent between 0.1 and 1.9.
The results are shown in Fig. 12. We can see a slight asymmetry between the two curves; this is because the filter with
the highest cut-off is too close to the sampling frequency. In applications where the sampling frequency is significantly
higher than the highest cut-off frequency, the curves can be approximated as c y, and c(2-) y respectively, where
c=1.78 and y=-0.874 for the filter used above.

16

14
First filter
Last filter
12

10
Multiplier

0
0,0 0,2 0,4 0,6 0,8 1,0 1,2 1,4 1,6 1,8 2,0

Fig. 12. The multiplier of the filters amplitude if we modify only the first and the last filter.

4. HARDWARE IMPLEMENTATION

PC RS 232 DSP D/A


1/f
noise
User interface
Fig. 13. The block diagram of our noise generator.

The system is built around a high performance fixed point ADSP-2181 from Analog Devices because it has easy
algebraic assembly syntax, efficient core and integrated peripherals. The standard serial RS-232 interface allows a host
computer to control the DSP noise generator, but stand-alone operation is also possible, yielding a very compact size
solution. An optional user interface (e.g. pushbuttons and LCD display) may be used to control the system manually. In
our experiments the DSP was controlled by a PC running LabVIEW development environment [5]. The DSP generated
a white noise random number sequence based on a tested linear congruential method, and successively applied second
order digital filters produced the 1/f noise. This sequence of random numbers were converted to the analogue domain
by a 14-bit digital-to-analogue converter allowing maximum update rate of 300 kHz. Let us note that the use of a
floating point DSP may provide more easy programming and higher performance at the expense of higher price, more
power consumption and different development tools. The block diagram of our device can be seen in Fig.13.
One of the major drawbacks to the fixed-point arithmetic is that there is a limit to its precision. If the results of
operations are too small, the relative error will be too large. On the other hand, if the results are too large, there will be a
risk of overflow or saturation. So we have to be careful choosing the coefficients in order to exploit the available
numeric range fully. A further problem is that also the coefficients of the filters can be stored with a limited precision.
To utilise the available numerical range fully, we should have the signal y (see Eq. 1) as high as possible, yet at the same
time it must not be too high because the signal may be saturated then. The value of the signal y depends on the cut-off
frequency and the amplitude of the filter; for each cut-off frequency we can find an amplitude or amplitude range where
we can exploit the available numerical range best. Our simulations have shown that the best amplitude is Ab=C/f 0.5. This
amplitude is ideal for generating 1/f noise, but if we should like to generate other types of coloured noises, we must
either choose an amplitude different from the ideal or initialise every filter with his parameter and perform the
weighting only before the summing. The noise generator realised by means of this method is shown on Fig. 14.

Ab1, f1 A1/Ab1
White
noise Ab2, f3 A1/Ab1 +
1/f
A1/Ab1 noise
Ab3, f3
. .
. .
. .
Fig. 14. The scheme of a noise generator that uses a modified filter arrangement.

We studied the transfer function of the filter thus set up also by means of numerical simulations and have found that
though the very first components are somewhat noisier, the deviation from the ideal frequency profile is not very
significant.
2.5
Theory

2.0
[au]

1.5
0.5
Amplitude * f

1.0

0.5

0.0
1E-3 0.01 0.1 1 10 100
Frequency [Hz]

Fig. 15. The transfer function approximates the theoretical profile fairly well.

It may be important to know the boundaries of the frequency range in which we can generate the desired noise. One of
the major limiting factors is the sampling frequency. We cannot place the filter with the highest cut-off too close to the
half of the sampling frequency, because the distortion of the transfer function due to the frequency transformation would
be too large then. At a sampling frequency of 1 kHz an upper frequency limit of 400 Hz seems appropriate. From the
figures above, we can see that the frequency profile agrees with what is desired fairly well until around one tenth of the
sampling frequency. Because of the frequency transformation, it is difficult to expand this limit. At the same time, there
is another limiting factor, due to the fact that we use a DSP with fixed-point arithmetic and thus we cannot store the
parameters of the filters with arbitrary precision. However, the precision of the value of C0 restricts the lower frequency
limit, which is 4.8610-6 fs under this value, we can represent only the zero frequency. We took into account these two
limits in arranging the filters.
The fixed-point arithmetic of the DSP can also be implemented on computer, so we can test the precision of the system
on computer and discover the errors that stem from an inappropriate arrangement in time. In this way we obtained the
noise spectrum in Fig. 16. We can see that the fixed-point realisation did not reduce the accuracy of the noise generator.

1E-3

1E-4
Power spectrum [au]
1E-5 1/f
1E-6

1E-7

1E-8

1E-9

1E-10
1E-3 0.01 0.1 1 10 100
Frequency [Hz]

Fig. 16. . The spectrum of the generated noise (simulation).


Power spectrum [au]

Frequency [Hz]
Fig. 17. The spectrum of the 1/f noise generated by our device (the sampling frequency is 100 kHz).

Finally, we should like to outline the algorithm that runs on the DSP. The noise generation routine is included in an
interrupt routine, where the interrupts come from a clock signal which can either be an internal clock signal from the
DSP or an external signal. At the beginning of the routine we implement a linear congruence method, which yields a 32-
bit integer. The cycle length of the random generator is determined by these 32 bits. If needed, we can apply a different
random generator method to increase the cycle length. After the random generator, we implement the individual filters,
and then the weighted sum of the output of these filters. Finally, we convert the data into a format compatible with the
D/A converter, and convert it to an analogue signal. The number of instructions that must be executed during one
instance of sampling is about 120. The DSP we applied is a 40-MHz DSP: it can execute 40 million instructions per
second (even multiplication is executed in one clock period). With this DSP, we can achieve a sampling frequency of
300 kHz. We plan to use a 160-MHz DSP (ADSP-2191) in the future, with which the maximal sampling frequency can
reach 1.3 MHz
5 CONCLUSION

A widely used technique of adding filtered white noise sources was used to realise an efficient mixed-signal circuit to
provide 1/f noise with tunable power exponent . Our compact design incorporates a high-performance fixed-point
DSP microcomputer, which generates the random numbers, makes the digital filtering, and drives a digital-to-analogue
converter to translate the generated signal into a real-world analogue signal. The system allows stand-alone, PC-
controlled or manually controlled operation, selection of power exponent between 0 and 2 in steps of 0.1. 1/f
spectrum is valid over more than four decades of frequency, which range can be shifted from a maximum frequency of a
few hundred kHz down to any lower frequency. Depending on the DSP clock frequency and digital-to-analogue
converter update rate a few MHz sampling rate is possible. Our further development plans include implementation of
more efficient coding, higher speed and accuracy and development of an easy-to-use manual user interface.
Further information (data and program samples) will be available on our homepage (http://www.noise.physx.u-
szeged.hu/Mingesz/NoiseGen.htm).

ACKNOWLEDGEMENTS

Our research has been supported by OTKA, under grant T037664. We should also like to convey our thanks to SMD
Technology Ltd (representative of Analog Devices Inc) and Cobra Control Ltd (representative of National Instruments)
for providing us with the development environments we used. We are also indebted to Sndor Nagy for his valuable
contribution.

REFERENCES

1. Z. Gingl, L.B. Kiss, R. Vajtai, "1/f k noise generated by scaled Brownian motion", Solid State Comm., 71, 765-767,
1989
2. M.L. Meade, "Time- and frequency-domain models for fractional noises", Proceedings of the 10th International
Conference on Noise in Physical Systems, A. Ambrzi ed., 347-350, Akadmiai Kiad, Budapest, 1989
3. Robin Whittle, "DSP generation of pink (1/f) noise", http://www.firstpr.com.au/dsp/pink-noise/
4. Analog Devices, http://www.analog.com/
5. National Instruments LabVIEW, http://www.ni.com/labview/

Das könnte Ihnen auch gefallen