# How to Provide delay in Bit Sequence in MATLAB?

Status
Not open for further replies.

##### Member level 2 Hello!

Can anybody answer me how can i provide delay of 260 ns in received signal?

The signal is received by passing tharough channel of 20 tap. Its complex valued signal!

#### roshn

##### Newbie level 3 It is easy to just use a timer in your code to hold and release or sent message to receiver.

Points: 2

##### Member level 2 Hello Roshn!

I have read the help, but still not able to get it.

data=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
data=(data*(-2)+1);

%The K parameter determines how many bits are in one frame:
%num_bits_per_slot=10*2^K.
%The spreading factor SF is related to K as: SF=512/2^K.
%Select spreading factor=256 so K=1 hence there will be 20 data bits/slot
%So datarate=30kbps (k==>1 20 bits/slot*15 slot/frame=300 bits/frame and
%frame period is 10 ms.

%let's select OVSF code of length 4 for maximum data rate.

SF=4;

%Generate OVSF code.
OVSF_code=OVSFC(SF,1);
OVSF_code=OVSF_code*(-2)+1;
%plot(OVSF_code);

unsprd=[];

for i=1:15
unsprd=[unsprd data];
end

%split the data to I and Q, then Spread, conjugate the Q branch. and then

I_brnch=[];
Q_brnch=[];

for i=1:2:300
I_brnch=[I_brnch, unsprd(i)];
Q_brnch=[Q_brnch, unsprd(i+1)];
end

%SF=256 ==>num_chips=20*15*256=76800chips/slot
Real=[];
Imag=[];
complex_baseband_signal_Pilot = 0;
for n=(1:length(I_brnch))
Real=[OVSF_code.*I_brnch ];
Imag=[OVSF_code.*Q_brnch ];

% complex baseband signal
complex_baseband_signal(SF*(n-1)+1:SF*n) = complex(Real,Imag);
end

%Complex Scrampbling.
[C1n_gold, SC_code]=scrambling(600, 500);

Data_scrambled=complex_baseband_signal.*SC_code;

% thermal noise generation with RMS noise_factor
thermal_noise = randn(1,length(Data_scrambled))*noise_factor + randn(1,length(Data_scrambled))*noise_factor*j;

% complex baseband signal is input into the estimated channel impulse response (hh)
channel_output = conv(Data_scrambled, hh);

% noise added to the channel_output
y = channel_output(1:length(complex_baseband_signal)) + thermal_noise;

I want to generate Delay in the signal Y

can u help me?

#### roshn

##### Newbie level 3 Okay, I will try.

Firstly why do you want to generate the delay? And do you want a delay of exactly 260ns? why?

##### Member level 2 In WCDMA RAKE RECEIVER the each finger is synchronised with single multipath having delay of one chip interval. That delay is 260 ns. That's why.....................

#### engr_najam

##### Full Member level 2 simply add zeros in front, accordingly to sampling time............

#### Communications_Engineer I think there is a program for delay in the book "Simulation & Software radio" by Ramjee Prasad. You can download the book from 4shared.com or gigapedia.com

#### roshn

##### Newbie level 3 adding zeros according to sampling time will certainly work and would be the easiest solution.

#### Communications_Engineer Yeah I suppose that would be the easiest approach

Status
Not open for further replies.