clear all;
load('chirp.mat'); % y & Fs
tr = randn(size(y));
Fy = fft(y);
Fr = fft(tr);
Phy = atan2(imag(Fy),real(Fy));
Phr = atan2(imag(Fr),real(Fr));
Phy(2:end)=Phr(2:end);
Fy1 = abs(Fy).*exp(1i*Phy);
y1 = ifft(Fy1);
subplot(2,1,1);plot(y);
subplot(2,1,2);plot(y1);