I have 256x256 image array (named Mydata
) and I applied FFT transformation as fftshift(log1p(abs(fft2(Mydata))));
How to inverse the transformation and image the results in MATLAB?
I have 256x256 image array (named Mydata
) and I applied FFT transformation as fftshift(log1p(abs(fft2(Mydata))));
How to inverse the transformation and image the results in MATLAB?
To fully reconstruct the image you will also need the phase. If you recall the properties of the Fourier Transform, you can decompose any signal into its magnitude and phase counterparts. What you have in this code is just the magnitude. Without the phase, you cannot faithfully reconstruct your signal. As such, you'll need to store the phase somewhere. Remember that any complex number
num
can be represented in Euler form, such that:abs
is the magnitude ofnum
andangle
is the phase ofnum
. Now, supposing you stored the magnitude and phase:Coincidentally,
angle
is the MATLAB function that determines the phase of every element in a complex-valued matrix. To achieve the inverse operation, you would simply reverse the operations that you did above to achieve the original image:expm1
is the MATLAB operation that performs the inverse oflog1p
.