The Importance of Phase
in Signals
Taufiq Widjanarko
August 2016
twidjana@gmail.com
Introduction
• Based on seminal work from Oppenheim & Lim
(Proc.of IEEE,69,529,1981)
• Emphasizing the quintessential role of phase in
signal  carrying the details of an image
• ‘Classic paper’  so far cited more than 1500
times (Google Scholar; 800 times – Web of
Science*) !
* citation data by 19 August 2016
Idea
• Any image has amplitude and phase
components (after Fourier transform)

IMG
Image IMG  A  
Im{IMG}
Re{IMG}
22
}Im{}Re{ IMGIMGA 
A
φ






 
}Re{
}Im{
tan 1
IMG
IMG

• Two images, with their amplitudes and phases of
images 1 and 2 are A1 , 1 and A2 , 2 ,
respectively.
• The test is to evaluate which component, i.e.
amplitude A or phase  , that carries image
details
Amplitude swapping
• Two images with swapped amplitudes
IMG_1
IMG_2
IMG_1  A1 1
IMG_2 A2  2
 1
A1
2
A2
 1
A2
A2
A1
IMG_1s
IMG_1s  A2 1
IMG_2s
IMG_2s  A1  2
FFT
IFFT
FFT IFFT
Results: amplitude swapping
A1
A2
A2
A1
1 1
2 2
• Swapping the amplitude, apart from
adding noise, doesn’t the image ‘content’
• Amplitude doesn’t carry the image
information
Phase swapping
• Two images with swapped phases
IMG_1
IMG_2
IMG_1  A1 φ1
IMG_2 A2 φ2
A1
φ1
A2
φ2
A1
φ2
A2
φ2
IMG_1s
IMG_1s  A1 φ2
IMG_2s
IMG_2s  A2 φ1
FFT
IFFT
FFT IFFT
Results: phase swapping
1
2
2
1
A1 A1
A2 A2
• The test results show, despite the
presence of noise, swapping the phase
will change the images
• Therefore phase carries the image details
• Provided the phase information is
preserved, the amplitude of image
therefore can be set to any value whilst
remains maintaining the details
Uniform, arbitrary value of
Amplitude image
Example Matlab script: Phase_swapping.m
%%Phase swapping.m
%to illustrate the important of phase, based on seminal work from Oppenheim & Lim
%(Proc.of IEEE,69,529,1981)
%Taufiq Widjanarko – Aug 2016 (twidjana@gmail.com)
clear all; close all; clc
%0. Read and display the orig.images
img1=imread('KingsCollegeChapelWest.jpg');
img2=imread('MIT_Building_10.jpg');
img1Gray=rgb2gray(img1);
img2Gray=rgb2gray(img2);
img1GrayRes=imresize(img1Gray,[256 256]);
img2GrayRes=imresize(img2Gray,[256 256]);
Ones256sq=ones(256,256); %array for swapping
figure;imagesc(img1GrayRes);colormap(gray);axis square;title('Orig.img 1: A_1e^{j theta_1}')
figure;imagesc(img2GrayRes);colormap(gray);axis square;title('Orig.img 2: A_2e^{j theta_2}')
%1.Extracting the amplitude and phase of each image
img1Mag=abs(fft2(img1GrayRes));
img1Phase=angle(fft2(img1GrayRes));
img2Mag=abs(fft2(img2GrayRes));
img2Phase=angle(fft2(img2GrayRes));
%%%2.A. Swapping: Amplitude (magnitude)
%amplitude swapping 1, magnitude: mag(img2), phase: angle(img1)
mag2phase1=img2Mag.*exp(1i*img1Phase); %Img1AmplitudeSwapped, magnitude: mag(img2), phase:
angle(img1)
figure;imagesc(abs(ifft2(mag2phase1)));colormap(gray);axis square
title('Amplitude Swapping 1: Ae^{j theta} - A=mag(img2), theta=phase(img1)')
%amplitude swapping 2: magnitude: mag(img1), phase: angle(img2)
mag1phase2=img1Mag.*exp(1i*img2Phase); %Img2AmplitudeSwapped, magnitude: mag(img1), phase:
angle(img2)
figure;imagesc(abs(ifft2(mag1phase2)));colormap(gray);axis square
title('Amplitude Swapping 2: Ae^{jtheta} - A=mag(img1), theta=phase(img2)')
%%%2.B. Swapping: Phase
%phase swapping 1: magnitude: mag(img1), phase: angle(img2)
mag1phase2=img1Mag.*exp(1i*img2Phase);
figure;imagesc(abs(ifft2(mag1phase2)));colormap(gray);axis square
title('Phase Swapping 1: Ae^{jtheta} - A=mag(img1), theta=phase(img2)')
%phase swapping 2: magnitude: mag(img1), phase: angle(img2)
mag2phase1=img2Mag.*exp(1i*img1Phase);
figure;imagesc(abs(ifft2(mag2phase1)));colormap(gray);axis square
title('Phase Swapping 2: Ae^{jtheta} - A=mag(img2), theta=phase(img1)')
%
%3. Phase Swapping, unit amplituides
% Unit amplitude 1: magnitude: ones(256x256), phase: angle(img1)
one256phase1=Ones256sq.*exp(1i*img1Phase);
figure;imagesc(abs(ifft2(on256phase1)));colormap(gray);axis square
title('Unit amplitude 1: Ae^{jtheta} - A=ones(256x256), theta=phase(img1)')
%
% Unit amplitude 2: magnitude: ones(256x256), phase: angle(img2)
one256phase2=Ones256sq.*exp(1i*img2Phase);
figure;imagesc(abs(ifft2(on256phase2)));colormap(gray);axis square
title('Unit amplitude 2: Ae^{jtheta} - A=ones(256x256), theta=phase(img2)')

The Importance of Phase

  • 1.
    The Importance ofPhase in Signals Taufiq Widjanarko August 2016 twidjana@gmail.com
  • 2.
    Introduction • Based onseminal work from Oppenheim & Lim (Proc.of IEEE,69,529,1981) • Emphasizing the quintessential role of phase in signal  carrying the details of an image • ‘Classic paper’  so far cited more than 1500 times (Google Scholar; 800 times – Web of Science*) ! * citation data by 19 August 2016
  • 3.
    Idea • Any imagehas amplitude and phase components (after Fourier transform)  IMG Image IMG  A   Im{IMG} Re{IMG} 22 }Im{}Re{ IMGIMGA  A φ         }Re{ }Im{ tan 1 IMG IMG 
  • 4.
    • Two images,with their amplitudes and phases of images 1 and 2 are A1 , 1 and A2 , 2 , respectively. • The test is to evaluate which component, i.e. amplitude A or phase  , that carries image details
  • 5.
    Amplitude swapping • Twoimages with swapped amplitudes IMG_1 IMG_2 IMG_1  A1 1 IMG_2 A2  2  1 A1 2 A2  1 A2 A2 A1 IMG_1s IMG_1s  A2 1 IMG_2s IMG_2s  A1  2 FFT IFFT FFT IFFT
  • 6.
  • 7.
    • Swapping theamplitude, apart from adding noise, doesn’t the image ‘content’ • Amplitude doesn’t carry the image information
  • 8.
    Phase swapping • Twoimages with swapped phases IMG_1 IMG_2 IMG_1  A1 φ1 IMG_2 A2 φ2 A1 φ1 A2 φ2 A1 φ2 A2 φ2 IMG_1s IMG_1s  A1 φ2 IMG_2s IMG_2s  A2 φ1 FFT IFFT FFT IFFT
  • 9.
  • 10.
    • The testresults show, despite the presence of noise, swapping the phase will change the images • Therefore phase carries the image details • Provided the phase information is preserved, the amplitude of image therefore can be set to any value whilst remains maintaining the details
  • 11.
    Uniform, arbitrary valueof Amplitude image
  • 12.
    Example Matlab script:Phase_swapping.m %%Phase swapping.m %to illustrate the important of phase, based on seminal work from Oppenheim & Lim %(Proc.of IEEE,69,529,1981) %Taufiq Widjanarko – Aug 2016 (twidjana@gmail.com) clear all; close all; clc %0. Read and display the orig.images img1=imread('KingsCollegeChapelWest.jpg'); img2=imread('MIT_Building_10.jpg'); img1Gray=rgb2gray(img1); img2Gray=rgb2gray(img2); img1GrayRes=imresize(img1Gray,[256 256]); img2GrayRes=imresize(img2Gray,[256 256]); Ones256sq=ones(256,256); %array for swapping figure;imagesc(img1GrayRes);colormap(gray);axis square;title('Orig.img 1: A_1e^{j theta_1}') figure;imagesc(img2GrayRes);colormap(gray);axis square;title('Orig.img 2: A_2e^{j theta_2}') %1.Extracting the amplitude and phase of each image img1Mag=abs(fft2(img1GrayRes)); img1Phase=angle(fft2(img1GrayRes)); img2Mag=abs(fft2(img2GrayRes)); img2Phase=angle(fft2(img2GrayRes));
  • 13.
    %%%2.A. Swapping: Amplitude(magnitude) %amplitude swapping 1, magnitude: mag(img2), phase: angle(img1) mag2phase1=img2Mag.*exp(1i*img1Phase); %Img1AmplitudeSwapped, magnitude: mag(img2), phase: angle(img1) figure;imagesc(abs(ifft2(mag2phase1)));colormap(gray);axis square title('Amplitude Swapping 1: Ae^{j theta} - A=mag(img2), theta=phase(img1)') %amplitude swapping 2: magnitude: mag(img1), phase: angle(img2) mag1phase2=img1Mag.*exp(1i*img2Phase); %Img2AmplitudeSwapped, magnitude: mag(img1), phase: angle(img2) figure;imagesc(abs(ifft2(mag1phase2)));colormap(gray);axis square title('Amplitude Swapping 2: Ae^{jtheta} - A=mag(img1), theta=phase(img2)') %%%2.B. Swapping: Phase %phase swapping 1: magnitude: mag(img1), phase: angle(img2) mag1phase2=img1Mag.*exp(1i*img2Phase); figure;imagesc(abs(ifft2(mag1phase2)));colormap(gray);axis square title('Phase Swapping 1: Ae^{jtheta} - A=mag(img1), theta=phase(img2)') %phase swapping 2: magnitude: mag(img1), phase: angle(img2) mag2phase1=img2Mag.*exp(1i*img1Phase); figure;imagesc(abs(ifft2(mag2phase1)));colormap(gray);axis square title('Phase Swapping 2: Ae^{jtheta} - A=mag(img2), theta=phase(img1)') % %3. Phase Swapping, unit amplituides % Unit amplitude 1: magnitude: ones(256x256), phase: angle(img1) one256phase1=Ones256sq.*exp(1i*img1Phase); figure;imagesc(abs(ifft2(on256phase1)));colormap(gray);axis square title('Unit amplitude 1: Ae^{jtheta} - A=ones(256x256), theta=phase(img1)') % % Unit amplitude 2: magnitude: ones(256x256), phase: angle(img2) one256phase2=Ones256sq.*exp(1i*img2Phase); figure;imagesc(abs(ifft2(on256phase2)));colormap(gray);axis square title('Unit amplitude 2: Ae^{jtheta} - A=ones(256x256), theta=phase(img2)')