# Filtering random Signal

My question is easy one actually.

First, I generate a random signal using randn() function of MATLAB like this:

Then, I design a FIR filter of order 200 of pass-band characteristics with the pass-band $[0.2\pi, 0.4\pi]$ using the MATLAB function fir2():

My questions are:

• What am I supposed to see when I filter a random signal using BPF?
• What change in the characteristics will be occur considering the theory?

## 2 Answers

The output signal will still be normally distributed, but its power spectrum, i.e. its frequency content, will obviously be different from the input signal. If $S_X(\omega)$ is the power spectrum of the input signal, which is approximately flat, then the power spectrum of the output signal is

$$S_Y(\omega)=|H(\omega)|^2S_X(\omega)$$

where $H(\omega)$ is the frequency response of the filter.

• Thanks for asnwer (: Actually I am wondering what am I supposed to see in band pass filtered random signal in time domain? I have some trouble about filtering the random signal I mean I may be applying the filter wrongly so I want to deduce or verify it. How to consider this problem? – mehmet Apr 27 '15 at 18:48
• @mehmet: You should cross-check your filtering routine with some standard routine as provided by Matlab/Octave (filter.m) or some other package. You can't just look at the filtered time-domain signal and say, well that looks good, probably my filter works as it should. – Matt L. Apr 27 '15 at 18:51
• Well I had planned to filter() function of MATLAB but it takes num and den of the filter as arguements. I have the values of the band pass filter in bot time and frequency domain. I don't know how I can get the num and den from this point? – mehmet Apr 27 '15 at 19:15
• @mehmet If h is the vector of filter coefficients returned from the function fir2(), and x is your random input signal, then you must use: y=filter(h,1,x); – Matt L. Apr 27 '15 at 19:21
• @mehmet: That's the same thing for an FIR filter, the filter coefficients are the same as the impulse response. – Matt L. Apr 27 '15 at 19:28

You will be creating a random band-pass signal.

What you are supposed to see for such a signal if you plot the time sequence, is a varying sinusoid of frequency $0.3 \pi$ (midpoint of the pass band). Amplitude and phase will vary randomly, depending on the signal bandwidth.

In your case, $0.2 \pi$ bandwidth is quite large compared to the carrier frequency of $0.3 \pi$, so the result should look quite erratic.

For a smaller bandwidth, amplitude and phase will vary more smoothly.

• This is very interesting! But I couldn't realize how I can deduce it would be a sinusoidal signal? – mehmet Apr 27 '15 at 19:19
• @mehmet: I'm afraid you won't see anything that is similar to a sinusoid. The one but last sentence of Juancho's answer ("...quite erratic ...") is more accurate than the description of the output signal as a "varying sinusoid of frequency $0.3\pi$". The latter would only be visible if the bandwidth was much smaller. – Matt L. Apr 27 '15 at 19:25
• I see it is some kind of aliasing effect. If I used much smaller band width I would have almost a dirac in frequency domain and it would be a sinusoidal signal. Now I understand the idea. Thank to both of you guys! @MattL. – mehmet Apr 27 '15 at 19:32