MATLAB: How generating band limited white noise with matlab

filter designMATLABnoisesignal processing

In matlab I use if true % code randn(1,length(N)) end to generate white noise… Now I would like to generate band limited white noise (e. g. from 240 to 435 Hz). How must I code that in matlab!?

Best Answer

That's not a very good approximation to a bandpass filter between 240 and 435 Hz.
Look at your magnitude response:
fvtool(B,A,'Fs',2000)
If you're going to use the window method, can you up the order significantly?
Compare your filter to:
[B1,A1] = fir1(48,[fd fu]/fn);
fvtool(B1,A1,'Fs',2000)
Now you can do:
noise_limited = filter(B1,A1,white_noise);