New answers tagged

1

clear; N = 4; M = 2*N-1; a = 1:4; r = ones(1, N); % Rectangular window A1 = fft(a); W = fft(r, N); A2 = (A1).*W; A3 = ifft(A2, N); B = 3:6; x = xcorr(A3,B) A4 = fft(A3,M); % A3 is interpolated by a factor of M B2 = fft(B, M); Freq_Multiplication = (A4.*conj(B2)); x2 = fftshift(abs(ifft(Freq_Multiplication, M))) % Zeropadding A2 ...


1

You can pad zeros in frequency domain. But you need to take care about Nyquist bin when N is even. A3 = [A2(1:N/2) A2(N/2+1)/2 zeros(1, 2*N-length(A2)-1) A2(N/2+1)/2 A2(N/2+2:end)]; Here Nyquist bin is A2(N/2+1)/2 and zeros are padded in the middle of the spectrum For N-odd A3 = [A2(1:(N-1)/2+1) zeros(1, 2*N-length(A2)) A2((N-1)/2+2:end)]; This is only ...


Top 50 recent answers are included