Code covered by the BSD License  

Highlights from
3SA (Spread Spectrum Simulation Application)

image thumbnail
from 3SA (Spread Spectrum Simulation Application) by Terrence Irving
An interactive application simulating a DSSS communication.

srrc_rec_filter.m
% SRRC_REC_FILTER    Applies a square root raised cosine filter to the
%   BPSK signal as it at arrives at the receiver.
%   This square root raised cosine filter will not upsample its input
%   (which is the output of the transmitter's square root raised cosine
%   filter), as specified by 'sqrt/Fs'.

%   Completeed: July 24, 2005

%   Terrence Irving
%   2005 NSF REU in SDR
%   Stevens Institute of Technology
%   Hoboken, NJ USA



% Globalize object handles that this component must access.
global srrc_2_pb sssa_base done_text_fontsize srrc_rec_done_dims srrc_1_pb

% Globalize the appropriate data created by this component.
global rec_carrier_filtered

% Change previous button's color (MATLAB 7 precaution).
set(srrc_1_pb, 'backgroundcolor', 'white');
set(srrc_1_pb, 'foregroundcolor', 'black');

% Set up filter parameters.
Fd = 1;                     % input signal's sampling rate
Fs = 2;                     % filter's sampling rate

% Create and apply a square root raised cosine filter without upsampling.
disp('Filtering received carrier signal');
rec_carrier_filtered = rcosflt(trans_carrier_filtered, Fd, Fs, 'sqrt/Fs');
disp('Received carrier signal filtered');
disp(' '); % blank line

% Free memory.
clear Fd Fs;

% Change button color and update text when component is finished.
set(srrc_2_pb, 'backgroundcolor', 'white');
set(srrc_2_pb, 'foregroundcolor', 'black');
srrc_2_done = uicontrol(sssa_base,...
    'style', 'text',...
    'fontsize', done_text_fontsize,...
    'foregroundcolor', 'white',...
    'backgroundcolor', [.5 0 0],... % matches background image color
    'horizontalalignment', 'center',...
    'string', 'DONE',...
    'position', srrc_rec_done_dims); 

% Pause for one second before continuing, giving the button time to update.
pause(1); 

% Continue on.
debpsk;

Contact us at files@mathworks.com