# How to compute impulse and frequency response of Flanger?

I have to the implementation of a Flanger effect on Matlab, buy previously I have to plot its frequency response and impulse response.

The difference equation is $y[n]=x[n]+a\cdot x[n-d[n]]$ where $a$ is a constant, $|a|<1$, and $d[n]=\frac D2 (1-\cos(2\pi f_s n))$; $D$ and $f \text{ const}$.

I'm having trouble on how to calculate any of DTFT o Z Transform of such difference equation. I can't find how to compute the varying time shifting transform for $x[n-d[n]]$.

Is there any other way to compute impulse and frequency responce?

However, in your case it should be quite easy to get a visual representation of how the impulse response of your system evolves over time. $d[n]$ is a function whose value changes sinusoidally in the interval $(0,D/2)$ at a rate determined by $f_s$.
Thus, I believe it might be useful for you to plot the impulse response (or frequency response) with different values of $d[n]$, spaced regularly over the interval $(0,D/2)$, and to have the plots overlaid.
You can make several plots with different $a$ and $D$ as well, if you want to get an idea on how these affect the behaviour of your system.