Is ideal band pass filter (brick wall filter) linear phase? [duplicate]

This question already has an answer here:

I'm very new in digital signal processing. I have multiple sensors and the way I filters the signals in post processing is:

1. take FFT of the signals.
2. put zero on out range of interesting frequency (like brick wall filter).
3. take IFFT of the spectrum.

I repeat this for each sensor, and compare the phase relation between them in time traces. Thus, the phase must not shift during the filtering process. I wonder the above method distorts the phase or not. Is the ideal band pass filter linear phase?

marked as duplicate by Stanley Pawlukiewicz, lennon310, Matt L., MBaz, jojek♦Oct 18 '18 at 12:06

• this is not a process running continuously, is it? __ or are you doing these three steps once to a piece of data? – robert bristow-johnson Oct 5 '18 at 23:46
• – Stanley Pawlukiewicz Oct 6 '18 at 0:54
• I did this in post processing, it's not a real time. – Jeong Won Kim Oct 6 '18 at 2:22

The impulse response $$h[n]$$ of the ideal brickwall bandpass filter : $$H(\omega) = \begin{cases} 1 ~~~,~~~ |\omega-\omega_c| is $$h[n] = 2 \cos(\omega_c n) \frac{ \sin(W n) }{ \pi n }$$
which is real and even symetric about origin; i.e., $$h[n] = h[-n]$$, hence it's a zero-phase (in the passband), but noncausal filter.
When this impulse response is truncated and shifted right enough to make it causal: $$h_c[n] = h[n-d]$$ then the resulting bandpass filter will be linear phase in the passband: $$H_c(\omega)= e^{-j\omega d} H(\omega)$$ with a linear phase term of $$\phi(\omega) = -\omega d$$