I am working on an alternative approach for a specific signal processing sequence which involves a kind of a test that I am using for justify the mathematical background of the design. The test is comprised of spreading ten harmonics of a sine function of frequency of 1 Hz over the frequency spectrum and interpreting the resultant magnitude and phase plots. While doing so, in contrast to the theoretical analysis, I’ve observed sinc-like sidebands and, as a result, a very confusing phase graph. The relevant MATLAB source code and consequent graphs are given below:
t = -10: 0.001: 10;
Ts = 0.001; % Sampling period in seconds
fs = 1000; % Sampling frequency in Hertz
function_0 = sin(2 * pi * t) + sin(4 * pi * t) + sin(6 * pi * t) + sin(8 * pi * t) + sin(10 *
pi * t) + sin(12 * pi * t) + sin(14 * pi * t) + sin(16 * pi * t) + sin(18 * pi * t) + sin(20 *
pi * t);
function_1 = (2 * pi * i * heaviside(t)) + (4 * pi * function_0 .* heaviside(t));
number_of_samples_1 = length(function_1);
number_of_samples_2 = power(2, nextpow2(number_of_samples_1));
f = linspace(-fs / 2, fs / 2, number_of_samples_2);
function_2 = fft(function_1, number_of_samples_2) * Ts;
function_3 = fftshift(function_2);
function_4 = abs(function_3);
subplot(2, 1, 1);
plot(f, function_4, "r");
xlabel("Frequency (Hz)");
ylabel("|Function-4 (f)|");
subplot(2, 1, 2);
theta = (180 * angle(function_3) / pi);
plot(f, theta, "r");
xlabel("Frequency (Hz)");
ylabel("\angle{Function-4(f)}");
According to the source code, the unit impulse response is;
$$h(t) = {j2\pi u(t)} + {4\pi \sum_{k=1}^{10} sin(2\pi kt)u(t)}$$
The reason for multiplying the imaginary part of $h(t)$ is achieving the same magnitude in the frequency domain.
We can split the unit impulse response $h(t)$ into two functions as in the expression below:
$$h(t) = a(t) + b(t)$$
The act of taking Fourier transform of $h(t)$ can be modelled as;
$$h(t) \xrightarrow{\mathscr{F}} H(f)$$
By assuming that the system of concern is LTI;
$$a(t) + b(t) \xrightarrow{\mathscr{F}} A(f) + B(f)$$
Let's find Fourier transforms of each function.
$$a(t) = j2\pi u(t) \xrightarrow{\mathscr{F}} A(f) = \frac{j2\pi}{j\omega} + {j2\pi \frac{\delta(f)}{2}}= \frac{1}{f} + j\pi \delta(f)$$
$$b(t) = {4\pi \sum_{k=1}^{10} sin(2\pi kt)u(t)} \xrightarrow{\mathscr{F}} B(f) = 4\pi [\frac{1}{j\omega} \ast \sum_{k=1}^{10} \frac{\delta(f+k) - \delta(f-k)}{j2}] = {\sum_{k=1}^{10} \frac{1}{f-k}} - {\sum_{k=1}^{10} \frac{1}{f+k}}$$
As a result, the frequency transfer function $H(f)$ becomes;
$$H(f) = {\frac{1}{f}} + {j\pi \delta(f)} + {\sum_{k=1}^{10} \frac{1}{f-k}} - {\sum_{k=1}^{10} \frac{1}{f+k}}$$
By creating the causal imaginary DC signal $a(t)$ and using causal sines, the following statements are true for the center and righ-hand side frequency components which are the only components of $H(f)$ that can be observed in real life spectrum measurements (which points out the single-sided Fourier transform);
Each component has nearly the same magnitude.
Each component's phase shift will be zero which corresponds to zero time delay in the time domain.
Note that the analysis is built upon CTFT and by the assumption that the time interval is not bounded.
What is the cause of those phenomena?
len(t)
long). Hilmar's other suggestion that the addition of a2 * pi * i * heaviside(t)
to the signal seems arbitrary and probably not what you want to do. Can you please edit your question and add the reasoning for this? $\endgroup$