I design a specific second order digital differentiator for a specific application where phase difference must be equal to pi over a specified frequency range. I use the following MATLAB prog. to determine the phase difference. Am I correct ?
[H,W]=freqz(B1,A1),
plot(W/pi,phase(H))
Specifically my question is, is phase response and phase difference are identical ?
You are doing right. But if your phase difference is not equal to pi. Than plesae cascade your system with a system having magnitude responce equal to 1 but phase compansate in such a way that you got a phase difference equal to pi.