%% Two Channels of Pink Noise
% Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For dsp.ColoredNoise System object™, myObject() becomes step(myObject). For all other objects, myObject(x) becomes step(myObject,x).
% Generate two channels of pink noise 1000 samples in length.

NumChannels = 2;
NumSamples = 1000;
cn = dsp.ColoredNoise('InverseFrequencyPower',1,'NumChannels',2,...
    'SamplesPerFrame',NumSamples);
x = cn();
subplot(2,1,1)
plot(x(:,1)); title('Channel 1');
subplot(2,1,2)
plot(x(:,2)); title('Channel 2');

% Copyright 2012 The MathWorks, Inc.