0
$\begingroup$

The basic idea of up-sampling is to add $M-1$ zeros after each sample. I need to make upsampling(factor of 3) of the function $rcosdesign(\beta, M, T)$ using the ZOH filter in Matlab. $\beta=0.25$, $M=6$, $T=4$.

I didn't get a full understanding of the upsampling using this filter, so i need help on how this should be done.

Thanks in advance!

$\endgroup$
1
$\begingroup$

ZOH and rcosdesign are two different things. What you mean may be is to generate a time domain filter of rcosdesign(0.25,6,4) and then use ZOH on it.

h=rcosdesign(0.25, 6, 4);

will generate the rcosdesign impulse function that you want. Then you need to upsample by 3 by interleaving 2 zeros in between each sample.

h_upsby3 = upsample(h,3);

Zero order hold is like a rectangular function in time domain. Here, for every sample of h_upsby3, there would be 3 ones to simulate a zero-order hold as per your specification.

r=ones(1,3);
y=conv(h_upsby3,r);

to generate a plot like this below enter image description here

| improve this answer | |
$\endgroup$
1
$\begingroup$

Upsampling is basically padding zeros in between signal samples and then interpolation. The interpolation itself is a low pass filter. The rcosdesign is a low pass filter so after zero padding by factor of 3, you need to convolve the resulting zero padded sequence with this filter.

Note that: it is not an ideal filter, so you would get varied attenuation for different frequencies for the discrete time frequency repsonse after convolving with this filter.

Further, remember you would be "drawing in" frequency components from other periodic repetitions of the discrete time frequency response of the original sequence immediately after zero padding, these would appear in the high frequencies of your $-\pi$ to $\pi$ spectrum hence roll off and spectrum of original sequence would decide the amount of alisaing and distortion of the original signal's frequency response.

As an example if your original sequence is bandlimited in $-\pi/4$ to $\pi/4$. Then this would shrink to $-\pi/12$ to $\pi/12$ after upsampling by 3 but you would also get frequency components to the left of $-7\pi/12$ and right of $7\pi/12$. So in this example make sure your roll of begins at $-\pi/12$ and $\pi/12$ and frequency resonse of filter decays very much to 0 before $7\pi/12$ and $-7\pi/12$

Sample MATLAB code below:

Sampling period implied and ignore the time scale:

close all;
clear all;
clc;

t=-5:0.1:5;
T=5;
RECT=rectpuls(t,T);
FFT_size=1024;

signal_fft=fft(RECT,FFT_size);


signal_up=upsample(RECT,3);
signalup_fft=fft(signalup,FFT_size);
h=rcosdesign(0.25,64,2);
H=fft(h,FFT_size);
Product=H.*signalup_fft;
filtered_sequence=ifft(Product,FFT_size);

figure;
subplot(6,1,1);
plot(t,RECT);
ylim([-2 2]);
xlim([-5 5]);
title('original signal');
subplot(6,1,2);
plot(fftshift(abs(signal_fft)));
title('frequency response of original signal,periodicity implied');
subplot(6,1,2);
plot(fftshift(abs(signal_fft)));
title('frequency response of original signal,periodicity implied');
subplot(6,1,3);
plot(fftshift(abs(signalup_fft)));
title('frequency response of upsampled signal,periodicity implied');

subplot(6,1,4);
plot(fftshift(abs(H)));
title('frequency response of rcosdesign filter,periodicity implied');

subplot(6,1,5);
plot(fftshift(abs(Product)));
title('frequency response of filtered sequence,periodicity implied');

subplot(6,1,5);
plot(filtered sequence);
title('recovered signal, ignore time scale');

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ thanks for the help, any chance you can explain to me how to do this on Matlab? $\endgroup$ – lasri23 Apr 12 at 10:24
  • $\begingroup$ @Iasri23 sure, give me sometime, I will paste all the plots and MATLAB code for the entire process $\endgroup$ – Dsp guy sam Apr 12 at 12:19
  • $\begingroup$ @Iasri23 attached the MATLAB code and plots to illustrate the concept I discussed in the answer, hope it helps $\endgroup$ – Dsp guy sam Apr 12 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.