Sampling signal after root raised cosine I am generating series of 1 and 0. then pulse shaped them with root raised cosine and after than deciding to do match filtering and recovering the bits however it turns out that I am not getting the correct bits.
What I do is as follow:


generate 0 and 1.
pulse shape them with RRC.
match filter using the same transmited filter
Remove samples up to peak using [val,pos]=max(mysignal)
sample using mysingal(pos:overample:end)


But what I get is not correct. I simulated this using 10 bits but I get only 2. I know there is something wrong but I do not know why. My method works when I only have one bit.

I am wondering if I have more than one bit should I do this procedure for every  bit.How can I approach this problem. 

This is also my code assume RX2 is the pulse shaped version of my signal and os is the oversampling factor and 0.25 is the roll of factor. I am wondering how to detect all the bits like all 10 or 100?

RX1=filter(srrc(os,0.25),1,RX2);
[val,pos]=max(RX1);
RX=RX1(pos:os:end);
Bits=RX;
One=Bits&gt;=Th;
BER=sum(One)/length(Bits);


The first one is the signal after passing through matched filter using conv command and no built in command like filter. the original bits are 0 0 1 1 1
Can anyone tell me how can I sample signal to get these bits back.
what command I should use. simply downsampling will not work.

The second one is for the same bits but using filter command for 0 0 1 1 1 can anyone please tell me how to obtain correct bits back from any of these figures.
I can visibly see from your figure that you have done the two cascaded RRC's properly. I circled the samples I would expect to see for your 00111 data sequence after RC filtering. Clearly you are using 8 samples per symbol, and a longer data sequence would continue in similar fashion after the initial delay that you have as shown.  



To demodulate this, you typically would have a timing recovery loop to establish the ideal sampling locations. There are several approaches to establish timing, but one recently discussed on this forum is the use of the Gardner TED (Timing Error Detector) which would create an error signal that you could use to control a timing sample location (increment up or down a position pointer based on the accumulated error, forming a timing recovery loop. This would be done using a (discardable) training sequence with lots of transitions, typically as part of the header for the data packet that would be significantly longer than your short data set. 

Another synchronizer I like is the M&amp;M synchronizer (Mueller &amp; Meuller) as well as excellent approaches I learned from fred harris using polyphase filters for timing synchronization (thank you fred!).

Below are links to recent discussions on the Gardner TED, but in particular I want to copy here the figure for the eye diagram of the transmitted symbols after they have gone through a root raised cosine (RRC) filter ("Before RRC Filter") the received signal after it has been passed through a second RRC filter as you are doing. Conveniently this was done with same alpha= 0.25 roll-off factor you have used, and what it shows is the continuous time representation of every possible trajectory between symbols based on previous symbol patterns. In your case, you have eight samples per symbol, landing on one of these trajectories.



Links to recent discussions on the Gardner TED:

Location of Matched Filter

Gardner Timing Recovery for Repeated Sybmols