What are Method to phase shift 50 Hz digital signal using microcontroller. Appart from storage of samples to array and shift sample wise,how to shift this signal fractionally.
You do it by creating a windowed sinc filter that has a wide enough pass-band to preserve the energy of whatever it is you are trying to phase shift. Instead of centering the sinc function, though, you shift it by whatever phase shift you want to introduce. You then filter the signal, which will now have that phase shift.
As Jason states in his comment, what we really want is a time delay, which means convolving with an impulse. The problem is that you can only do delays that are an integer multiple of the sample period with this technique. We get around that by creating a low-pass filter in the form of a windowed sinc. This is effectively the same as an impulse in terms of faithfully reproducing the signal-of-interest as long as the energy of the SOI is within the pass-band of the LPF. We then convolve the LPF with a fractionally delayed impulse. We do this by calculating the values of the underlying sinc function at those shifted time points.
Because convolution is a linear operation convolving your signal with the shifted sinc is equivalent to convolving the signal with a fractionally shifted impulse function and then convolving it with a LPF.
I agree with answer from Jim Clay. But if you need very fast algorithm and accuracy of results is not your main purpose, you can use a simple linear interpolation. For example, if you want to do shift by half of sample resolution you can use:
y[i] = (x[i+1] + x[i])/2
Yes, it is low-pass filter too, but very simple and very short. If you need more accurate results - use common answer from Jim Clay and carefully choose length of filter.