# How to create a band limited signal of sine waves that is nearly uniform distributed

I would like to create a signal that is nearly uniform distributed (as depicted in Figure 1). It must consist of some single sine waves (e. g. 400 Hz, 430 Hz, 500 Hz) or a random band limited signal (e g. 495 to 500 Hz as depicted in Figure 2).

I expiremented with some parameters but I didn't get a good result. Does anyone know an analytical mathematical description or a kind of "thumb rule" for creating such signals?

Additionally I would prefer a signal that is as harmonic (in time domain) as possible (one single frequency would be the best - but of course not possible ;-) ). The signal is faded in and out with an raised cosine, because it's repeated periodically by a signal generator and I want to avoid steps in my signal.  To answer the "why" question: I have an nonlinear system which I want to correct by avaraging (see picture 3). Usually I would get the red point which differs from the linear "true" value represented by the blue dotted line. The magenta colored dots are createt by a sine-wave and the big blue dot is gained through the avaraging of those magenta dots. This works whith a sine-wave signal, but since a sine-wave is not uniform distributet it is not perfect and the big blue dot differs from the big green dot representing the true value.

I tried to combine three sinusoids with different amplitudes. The result was not to bad but its a trial and error way. I would prefer an analytical way if there is any. • i thought i could understand, from the title, what the question was. but from the discussion, it's a lot harder to decode what is meant. does the OP want a testing signal that is flat in power spectrum over a given band? – robert bristow-johnson Mar 9 '15 at 3:31

This is a wierd thing you are trying to do. What i the purpose behind this signal generation? What particular application needs this?

I think of two ways, but maybe one is not correct.

1 - Generate Uniform White noise, and then filter it to your desired bandwith of interest. But that will surely affect the probability distribution of the amplitudes and make it more laplacian, like your graph shows.

2 - Generate Any signal you want with the desired narrow bandwith (Still not sure why you need this, but let's say you do). you could use method one for it. Then estimate the probabiliy density with any method, like periodogram like you did, or Kernel Density estimation with parzen windows, etc. Then, design a non-linear transformation that you can apply sample to sample, in order to go from the probability density that you have, to a uniform. This non linear transofrmation is actually the "Inverse Probability distribution" that you have.

If you estimate your density in discrete intervals with periodogram, maybe you could look at the form of the graph and try to guess what functional form it has, then fit it with least squares to a continuous function, and then obtain the Probability Distribution from that, find the inverse, and apply that transformation to every sample. That should give you a signal which is uniformly distributed.

I am guessing now, but i think that your bandwith will not be preserved by this transformation. I have actually never studied the relationship between bandwith and probability density of the amplitudes. But try it and see what happens.

hope it helps.

Edit: I think you are trying to do is Least Squares fitting. It is the most mathematically correct application of "averaging to get rid of interferences and unwanted noise", or of linearizing a non-linear systems. Take all your measurments, and fit them to a line. There are 5 types of Least Squares methods:

• Least Squares with $L_{2}$-norm

• Least Squares with $L_{1}$-norm

• Least Squares with $L_{\infty}$-norm

• Total Least Squares

• Data Least Squares

Try some of them and see which one gets better result for your particular application.

• You are rigth an wrong! Least Squares is one option but in the situationway described in picture3. In the situation in picture3 I don't know the the horizontal axis of the magenta colored values (the axis is displayed becaus it's a simulation). So I think the only way to handle this is avaraging all vertical values to estimate the horizontal value. For this situation I still need this weird uniform disribution signal. Thank you for listing the 5 LS-Methods anyway they are not applicable in this situation. I will examine them. Unfortunally I can't upvote your answer because of my reputation ;-) – Semjon Mössinger Jan 31 '14 at 8:05
• It's ok, but even though you "Technically" dont't have an horizontal axis, and you just inventeded it for the simulation, you could do exactly that to do the estimation. I mean, if you built a linear array to make the graph, you could just put your data, along with sample instants, and do LS anyway, then when you obtain a point, you just make use of only one coordinate. It doesn't matter that you have just one dimensional data, you could think of it as introducing a "dummy" dimension just for the purposes of LS, and then getting rid of it. Graphically it seems that it is the way to go. – bone Jan 31 '14 at 14:01

As bone said, the task sounds somewhat arbitrary. However, it does not appear to be impossible. I assume you want the frequency content to be distributed normally around a center frequency, this appears not to be very clear though.

Besides filtering white noise with a filter of the desired profile (which appears to be easy), you could multiply a sinusoid which has the center frequency with a signal that has the desired profile around DC. By the convolution theorem, this would bring your signal.

The question would then be how to generate a normally distributed signal around DC. Luckily, normal distributions are mapped to normal distributions by the FT, so you would just need to window by a normal distribution (a gaussian).

• I think he doesn't mean uniform in frequency, but uniform in amplitude. I have studied a lot about stochastic procesess and random signals and correlation and also a lot about signals ans systems and frequency response, but for some reason, which probability distrubution the random signal has is never really dealt with, and they always assume it is gaussian. And also the relation between the Pdf of the amplitude and the frequency content is never analized, i don't know if there is any relation. – bone Jan 30 '14 at 17:06
• Bone is right . – Semjon Mössinger Jan 30 '14 at 19:14