Error while using bandpass function in Matlab

986 Views Asked by At

I am trying to make a superheterodyne receiver in Matlab. This is the block diagram given in my book:

enter image description here

I have implemented the modulation of signal :

freq_message = 1;
freq_carrier = 10;

w_message = 2*pi*freq_message;
w_carrier = 2*pi*freq_carrier;

message_signal = 5*cos(w_message*time);
carrier_signal = 10*cos(w_carrier*time);

modulated = message_signal .* carrier_signal;

Now I wish to add a band pass filter at the beginning of the receiver and I tried using the in-build bandpass function:

err = 1; % bandpass freq_carrier-err to freq_carrier+err
out_bandpass = bandpass(modulated,[freq_carrier-err,freq_carrier+err]);

But I am getting this error:

Error using signal.internal.filteringfcns.parseAndValidateInputs>validateParameters (line 229)
Normalized passband frequency values must be in the (0,1) interval. Use a value in the (0,1) interval or specify a sample rate.

Error in signal.internal.filteringfcns.parseAndValidateInputs (line 98)
opts = validateParameters(opts);

Error in bandpass (line 103)
opts = signal.internal.filteringfcns.parseAndValidateInputs(x,'bandpass',varargin);

Error in untitled (line 66)
out_bandpass = bandpass(modulated,[freq_carrier-err,freq_carrier+err]);

0

There are 0 best solutions below