Block Hilbert transform on the basis of the FFT.This program calculates the block Hilbert transform and plots the spectrum power density of the received analytical signal.
The white Gauss casual process is used as an input signal.
As a result of running the program, the text file
hilbert_fft.txt where samples of the spectrum power density (SPD) of the received analytical signal are saved will be created in the directory
The SPD chart plotted according to samples from
hilbert_fft.txt is shown in the figure below.
It is possible to see the high level of SPD side lobes in the negative frequency area.
This effect is caused by the fact that the size of the block Hilbert transform
NFFT is less than the size of the SPD vector
This example visually illustrates that using the Hilbert transform on the basis of the FFT we reset to zero values of fixed frequencies in the negative area, but we do not control the SPM way between spectrum samples which are reset to zero.
This effect bears the name of Gibb’s effect and it is visualized upon plotting filters on the basis of frequency capture.
#define N 65536
#define NFFT 64
#define NPSD 2048
#define FS 1
void *pdspl = NULL;
hDSPL = dspl_load();
printf("dspl.dll loading ERROR!\n");
memset(y, 0, N*sizeof(double));
n = 0;
while(n + NFFT <= N)
memcpy(y+n+NFFT/4, z+NFFT/4, NFFT/2*sizeof(double));
DSPL_WIN_HAMMING | DSPL_WIN_PERIODIC, 0,
NPSD, NPSD/2, pdspl, FS, psd, frq);
for(n = 0; n < NPSD; n++)
psd[n] = 10*log10(psd[n]);
dspl_fft_shift(psd, NULL, NPSD, psd, NULL);