why do low pass and high pass filters generate a phase shift?

I just learned following notation for a sine wave:

$A e^{j\phi t}$

A low passfilter and a highpass filter respectively generate a phase shift in the complex plane of the sine wave as follows:

$A e^{-j\phi t}$ and $A e^{+j\phi t}$

I don't understand what phase shifting has to do with letting higher or lower frequencies intact... How do these things( filtering and phase shifting) relate to each other? They just seem like to completely and independent things to me

I just learned following notation for a sine wave: $Ae^{j\phi t}$

well, that's not really a sine wave; that's a complex sinusoid. The real and imaginary parts of that are cosine and sine, respectively.

A low passfilter and a highpass filter respectively generate a phase shift in the complex plane of the sine wave as follows:

No. There's all kind of LPFs and HPFs, and only the linear phase ones do what you claim.

The point is that (although you're basically asking us to write a textbook on filter and signal theory) you'd typically understand filters as systems with poles and zeros, as the transfer function of LTI (linear, time-invariant) systems can usually be written as fraction with polynomials (which have roots).

Now, to find something that actually fulfills the boundaries these representations set, your system needs to move its response in relation to frequency over the complex plane; "moving over the complex plane" is something that can be understood as changing a complex number over a variable; the rate of change of the argument of that number is a phase shift.

It can be shown (and you'll probably learn this later on) that you cannot change the magnitude of a signal over frequency (i.e. do the filtering) without changing it's argument.

• The user has already selected this as an answer but I guess you should better add a discussion on Group Delay which is responsible for keeping high and low frequencies intact or not, as the user is asking to learn in his last paragraph... – Fat32 Feb 8 '16 at 23:22
• @fat32 I really want to do that, but: to be honest, OP needs a text book and not a short answer. Me writing down stuff that then also lacks background will not make my answer really that more helpful. I kind of feel like the purpose of my answer was to motivate OP to look further. – Marcus Müller Feb 9 '16 at 7:49

Because they need a certain time delay in order to "decide" what the output should look like if the output changes a lot. Imagine you see a number series and your brain has to decide what the mean value of these number series is. You will need to look at several numbers to arrive at some reasonable conclusion (let's assume the numbers are represented by a noise distribution with the same mean). The same applies to filters that weigh signal values to arrive at the filtered output signal.

Any filter that does not employ prediction of output will have phase shift. The only way to get rid of phase shift completely (or keep it to fractions of dB) is to use a predictive filter - for example kalman filter. Such a filter, in the simplest form will estimate the derivative of the signal and use that to filter the original signal in a predictive fashion. If you have a model of your signal you can do even better. Since prediction and sensor measurements can be processed in the same time step, from a discrete time point of view you can have zero phase shift if prediction is able to estimate the original signal precisely.

• This is pretty great for intuitively understanding the problem, thanks. I guess the predictive filtering approach has problems when there are sharp changes in a given frequency (e.g. the onset of drum sample in audio)? – naught101 Aug 14 '18 at 3:10
• It depends on how you set your kalman gains. You can use moen4 matlab function to spit out your system, then use autocovariance least squares to spit out your Q and R and then use lqe to spit out your optimal kalman filter. If you feed such system with a bunch of drum signals you will get the OPTIMAL filter that will be able to predict the signal from a set of monitored quantities. If your filter then cuts off a piece of drum onset curve then that's precisely what it is supposed to do given your constraints because it is an optimal estimator for your particular set of training signals. – Martin Aug 14 '18 at 12:57
• If you use the signal itself to solve for your kalman gain then you would need to derive an optimal derivative offline and filter it using offline techniques to get a good filter. You can do this using sgolayfilt function or some approach that utilizes no phase shift filtering to get a smooth derivative on which you then do system identification together with your actual signal and produce a filter that will then take your signal and produce a smooth version of it as well as a high precision estimate of it's derivative. – Martin Aug 14 '18 at 13:00