Is this function convex or not? Is this function convex ?
$$
f(\mathbf y) = { \left| \sum_{i=1}^{K} y_i^2e^{-j\frac{2\pi}Np_il} \right| \over\sum_{i=1}^{K}y_i^2}
$$
where : $  P = \{p_1,p_2,\cdots,p_K\} \subset\{1,2,\cdots,N\} $
I tried to plot it and see whether it is convex or not, but since we are able to plot for two variables, i can check it only for $K=2$, So, I'm looking for any analytic answers.

No. The function is homogeneous of order zero, i.e., $f(ty)=f(y)$ for any nonzero $t\in\mathbb{R}$, $y\in\mathbb{R}^n$. If such a function is convex, it is necessarily constant. To see this, pick any two linearly independent $x$, $y\in\mathbb{R}^n$, and let $z=x+y$, so that any two of $x$, $y$, $z$ are linearly independent. Now each of the three vectors is a convex combination of some multiples of the other two, and by homogeneity and convexity, $f(x)\le\max(f(y),f(z))$, $f(y)\le\max(f(x),f(z))$, and $f(z)\le\max(f(x),f(y))$. This implies that all three values are equal, and in particular, $f(x)=f(y)$.
