# How to get Fourier transform of rectangular window as shown by wvtool function?. Why frequency domain of rectwin(M) using fft and wvtool are different?

69 visualizzazioni (ultimi 30 giorni)
Palguna Gopireddy il 26 Gen 2022
Commentato: Paul il 31 Gen 2022
rectangular window rectwin(M) is plotted in time domain and freuquency domain using wvtool.
But when I take fft of rectwin(M), it is giving the below result.
How to get the frequency domain as shown by wvtool?
WHy frequency domain of rectwin(M) using fft and wvtool are dfifferent?
##### 0 CommentiMostra -1 commenti meno recentiNascondi -1 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Paul il 26 Gen 2022
Modificato: Paul il 26 Gen 2022
It looks like wvtool is plotting the DTFT of rectwin(M)
[h,w] = freqz(rectwin(64),1);
figure
plot(w,db(abs(h)))
The DFT (as computed by fft() ), should be nonzero only at DC, and it is.
figure;
stem((0:63)/64*2*pi,abs(fft(rectwin(64))))
xlim([-0.1 2*pi])
How did you make your FFT plot?
As must be the case, the elements of the DFT are samples of the DTFT, as shown here plotted in absolute magnitude, not dB
figure
plot(w,(abs(h)))
hold on;
stem((0:63)/64*2*pi,abs(fft(rectwin(64))))
xlim([-0.1 pi])
##### 4 CommentiMostra 3 commenti meno recentiNascondi 3 commenti meno recenti
Paul il 31 Gen 2022
E_HH = rand(90,45) + 1j*rand(90,45);
r = rectwin(90)*rectwin(45).';
isequal(E_HH,E_HH.*r)
ans = logical
1
So mutiplying E_HH by r should not have an effect on the results. But the images above are not the same, so there must be some other difference in the processing the led to those images.

Accedi per commentare.

### Categorie

Scopri di più su Discrete Fourier and Cosine Transforms in Help Center e File Exchange

R2021a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by