sr=256000.0; % Symbol rate
IPOINT=8; % Number of oversamples
irfn=21; % Number of filter taps
alfs=0.5; % Rolloff factor
[xh] = hrollfcoef(irfn,IPOINT,sr,alfs,1); %Transmitter filter coefficients
data=rand(1,nd)>0.5; % rand: built in function
%*** BPSK Modulation
data1=data.*2-1; %0/1 to -1/1 translation
[data2] = oversamp( data1, nd , IPOINT) ;
data3 = conv(data2,xh); % conv: built in function
out=zeros(1,nd*IPOINT);
out(1:IPOINT:1+IPOINT*(nd-1))=data1
demodata=data3 > 0; %demodata=1 if >0, demodata=0 if <0
I am not quite sure what you mean here. I can use 10-bit for signed 2's compliment representation of data. 2^10 gives 1024 different levels, that's +/- half if 1st bit is used for sign. Did you mean something else?mc_navman said:Actually you need to change to using integers instead of real numbers. So 0-1 will give you 2 possible values. try 0-65535.
mc_navman said:If you wanted to add amplitude encoding with using a multiply you could go to 1/2 and 1/4 amplitudes by right shifting the output from your lookup table ie div by 2. Except that you have 2s compliment you could still right a simple right shift that kept the sign bit in tact. Or you could use 2 lookup tables at different amplitudes and just switch between them this would be much less efficient.
Good luck.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?