Interpolation/Up sampling MATLAB source code

This section of MATLAB source code covers interpolation or up sampling matlab code. It covers basics of interpolation/up sampling.

Interpolation refers to adding samples in between the existing vector of values. By doing so sample rate of the signal or vector will increase hence it is referred as up sampling the signal.

The best approach is to insert approximate values of two samples for adding the in between sample values. There are various techniques such as nearest, linear,spline,cubic etc.

Setting up exponential vector to be upsampled

clear all;
n=input('enter length of input sample sequence:');
l=input('enter the value of up-sampling factor:');

a=input('enter the value of base of exponent function:');

Upsampling the exponential vector

figure,stem(m,x);xlabel({'Time n';'(a)'});ylabel('Amplitude');title('Interpolation input');
figure,stem(m,y(1:length(x)));xlabel({'Time n';'(b)'});ylabel('Amplitude');title('upsampled output');

Upsampling using resample matlab function

yi = resample(xi,l,1);
figure,stem(m,yi(1:length(x)));xlabel({'Time n';'(b)'});ylabel('Amplitude');title('upsampled output using matlab function');

Other MATLAB function for interpolation or upsampling is 'interp1' .

Input and Output

Interpolation matlab code input
interpolation input exponential function
upsampled output
upsampled output matlab function

Useful Links to MATLAB codes

Refer following as well as links mentioned on left side panel for useful MATLAB codes.
OFDM Preamble generation  Time off estimation corr  Freq off estimation corr  channel estimation  11a WLAN channel  PN sequence generation  OFDMA Tx Rx  AES DES  carrier aggregation  CCDF  FIR Filter  IIR Filter  Low Pass FIR  Viterbi decoder  CRC8 CRC32 

RF and Wireless tutorials

WLAN  802.11ac  802.11ad  wimax  Zigbee  z-wave  GSM  LTE  UMTS  Bluetooth  UWB  IoT  satellite  Antenna  RADAR