interpolate using rcosdesign in matlab

To interpolate a signal using rcosdesign in MATLAB, you can follow the following steps:

  1. Design the raised cosine filter using the rcosdesign function. The raised cosine filter is a low pass filter used for pulse shaping in digital communication systems. The rcosdesign function is used to design a raised cosine filter with a given filter length, cutoff frequency and roll-off factor.
main.m
span = 10; % Number of symbols the filter spans
k = 4; % Roll-off factor
sps = 4; % Number of samples per symbol
beta = 0.25; % Cutoff frequency

h = rcosdesign(beta, span, sps, 'normal', k); % Design the raised cosine filter
226 chars
7 lines
  1. Upsample the signal using the upsample function. Upsampling is the process of adding zeros between the original samples of a signal, thereby increasing the sample rate.
main.m
x = [1 0 0 1]; % Original signal
x_upsampled = upsample(x, sps); % Upsample the signal
87 chars
3 lines
  1. Apply the designed filter to the upsampled signal using the filter function. The filter function is used to filter a signal with a given filter.
main.m
y = filter(h, 1, x_upsampled); % Filter the upsampled signal with the raised cosine filter
91 chars
2 lines
  1. Downsample the filtered signal using the downsample function. Downsampling is the process of removing samples from a signal, thereby decreasing the sample rate.
main.m
y_downsampled = downsample(y, sps); % Downsample the filtered signal
69 chars
2 lines

The filtered and downsampled signal y_downsampled is the interpolated version of the original signal x.

gistlibby LogSnag