www.gusucode.com > phased 案例源码 matlab代码程序 > phased/PreamplifyCosineWaveExample.m

    %% Preamplify a cosine wave
% This example shows how to construct a Receiver Preamp System object
% with a noise figure of 5 dB and a bandwidth of 1 MHz and then 
% use its |step| method to amplify a sine wave.
%%
% Construct the Receiver Preamp system object.

% Copyright 2015 The MathWorks, Inc.

hrx = phased.ReceiverPreamp('NoiseFigure',5,'SampleRate',1e6);

%%
% Create the signal.
Fs = 1e3;
t = linspace(0,1,1e3);
x = cos(2*pi*200*t)';

%%
% Use the |step| method to amplify the signal and then plot the
% first 100 samples.
y = step(hrx,x);
idx = [1:100];
plot(t(idx),x(idx),t(idx),real(y(idx)))
xlabel('Time (s)')
ylabel('Amplitude')
legend('Original signal','Received signal')