$Z$ transform with $\sin$ and $\cos$

284 Views Asked by At

I was trying to solve this $z$ transform $(-1)^{\frac{n}{2}}\cos(\frac{n\pi}{4})\sin(\frac{n\pi}{4})$ giving values to $\sin$ and $\text{cosine}$, I have understand that every $8$ the sequence will be equal : $(-1)^{(n/2)}$* this values for those 7 values..

$n=0$: $0$

$n=1$: ${1}/{\sqrt(2)}$

$n=2: 0$

$n=3 : {1}/{\sqrt(2)}$

$n=4: 0$

$n=5: -{1}/{\sqrt(2)}$

$n=6: 0$

$n=7: -{1}/{\sqrt(2)}$

So, I can divide for each case $8k , 8k+1 , 8k+2,8k+3,\cdots ,8k+7$ but it will be pretty slow. So i have two questions:

This is a valid way? and

is there some fastest way ?