5.0

5.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 1.89 KB File ID: #23414

1D Fourier shift

by Tim

 

24 Mar 2009 (Updated 11 Feb 2010)

Shift 1D signals using the Fourier shift theorem.

| Watch this File

File Information
Description

This code uses the Fourier shift theorem to cyclically shift 1D signals by an arbitrary amount. Both integer and non-integer shifts work.

It also supports padding the signal with zeros so that the shift appears non-cyclic (although it really isn't). If this is done then the shift amount is clamped so that the signal can't cycle round again.

It works with signals of any length and is completely vectorised.

Usage:

y = FourierShift(x, delta, zero_pad)

x = input vector (column or row)
y = output column vector
delta = shift amount in samples
zero_pad (optional) = if set to 'pad' then it simulates non-cyclic shifting

Example:

for ii = -50:0.4:50
plot(FourierShift(sinc(-2:0.1:2), ii, 'pad'))
pause(0.1);
end

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
13 Oct 2010 Stephen  
Please login to add a comment or rating.
Updates
11 Feb 2010

Small fix for even-length signals.

Tag Activity for this File
Tag Applied By Date/Time
signal processing Tim 24 Mar 2009 14:03:04
fourier Tim 24 Mar 2009 14:03:04
shift Tim 24 Mar 2009 14:03:04
interpolation Tim 24 Mar 2009 14:03:04
rotate Tim 24 Mar 2009 14:03:04
delay Tim 24 Mar 2009 14:03:04

Contact us at files@mathworks.com