I have a sum of a complex function, just like the following $$ f(\phi)=\sum_{n=0}^{N-1} \exp\left\{i \left[ A\phi_n - B\cos(\phi-\phi_n)\right]\right\}, \quad \phi_n=\frac{2n\pi}{N} $$ where $A$ is an integer, $B$ is real constant, and $N$ is usually greater than $2A$. I am trying to find the extrema of $|f(\phi)|$ in the domain $\phi\in[0,2\pi]$.
I tried to calculate the first derivative of $f(\phi)$, and make $f'(\phi) = 0$, however I cannot solve this too! Later, I realized that this is a complex function and its absolute, this method seems wrong.
I also tried to simulate the curve of $|f(\phi)|$ with Matlab, and got the results as shown below.
The curves of $f(\phi)$ simulated by Matlab
where $A=2,3$, $B=4.2$, $N=7$. These parameters are the values that appear in practical applications.
I found that there are $N$ maxima and $N$ minima, and they are distributed periodically with a period of $\frac{2\pi}{N}$, but I don’t know how to derive it mathematically.
The Matlab code is here
N = 7;
B = 4.2;
A = [2,3];
phi = linspace(0,2*pi,361)';
f = zeros(361, 2);
for iA = 1 : 2
a = A(iA);
for n = 0 : N-1
phin = 2*pi*n/N;
f(:,iA) = f(:,iA) + exp(1i*(a*phin - B*cos(phi-phin)));
end
end
figure; plot(phi, abs(f));
axis tight; grid on;
set(gca, 'XTick', linspace(0,2*pi,N+1));
ylim([0.5, 5.5])
xlabel('\phi');
title('|f(\phi)|');
legend('A=2','A=3')
Please, any help will be appreciated.