Digital Signal Processing Reference
In-Depth Information
else
error(ERROR!!! This constellation size not supported)
end
Similarly the state initialization function sets all the states for the modulator for chunk-by-chunk
processing of data. For this simple example, the symbols are first zero-padded and then they are
passed through a Nyquist filter. The delay line for the filter is initialized in this function. For more
complex applications this function may have many more arrays.
function STATES = MOD_States_Init(PARAMS)
% Pulse shaping filter delayline
STATES.filter_delayline = zeros(1,length(PARAMS.Nyquist_filter)-1);
And finally the actual modulation function performs the modulation on a block of data.
function [out_data, STATES] = Modulator(in_data, PARAMS, STATES);
% Bits to symbols conversion
sym = reshape(in_data,PARAMS.BPS,length(in_data)/PARAMS.BPS)';
% Binary to decimal conversion
sym_decimal = bi2de(sym);
% Bit to symbol mapping
const_sym = PARAMS.const_Table(sym_decimal+1);
% Zero padding for up-sampling
up_sym = upsample(const_sym,PARAMS.SPS);
% Zero padded signal passed through Nyquist filter
[out_data, STATES.filter_delayline] =
filter(PARAMS.Nyquist_filter,1,up_sym,
STATES.filter_delayline);
This MATLAB example defines a good layout for implementing a real-time signal processing
application for subsequent mapping in software and hardware. In complex applications some of the
MATLAB functions may be mapped in SWwhile others are mapped in HW. It is important to keep
this aspect of system design from inception and divide the implementation into several components,
and for each component group its data of parameters and states in different structures.
3.2.4 Fixed-point versus Floating-point Hardware
From a signal processing perspective, an algorithm can be implemented using fixed- or floating-
point format. The floating-point format stores a number in terms of mantissa and exponent.
Hardware that supports the floating point-format, after executing each computation, automatically
scales the mantissa and updates the exponent to make the result fit in the required number of bits in
a defined way. All these operations make floating-point HW more expensive in terms of area and
power than fixed-point HW.
Search WWH ::




Custom Search