Convolution of Signal with a Gaussian Filter / Kernel
If you have an implementation you want to validate the best way to do it is by validating it versus a reference implementation.

For instance, the above, in MATLAB, would be something like:



% Setting the Grid Parameters
leftBound = -10;
rightBound = 10;
numSamples = 10000;

% Signals Parameters
gaussianKernelStd   = 2;
gaussianKernelMean  = -1; %&lt;! Basically its shift on the grid
sineAmp             = 0.1;
sineFreq            = 1;
sinePhase           = 0;

% Generating the grid
vX = linspace(leftBound, rightBound, numSamples + 1);
vX = vX(:);

samplingInterval    = mean(diff(vX));
samplingFrequency   = 1 / samplingInterval;

% Generating the Sine Signal
vS = sineAmp * sin((2 * pi * sineFreq * vX) + sinePhase);
% Generating the Gaussian Kernel
vK = exp(-((vX - gaussianKernelMean) .^ 2) / (2 * gaussianKernelStd * gaussianKernelStd));
vK = vK / sum(vK * samplingInterval); %&lt;! Normalization

vY = conv(vS, vK, 'same');

figure();
% plot(vX, vK);
% figure();
% plot(vX, vS);
plot(vX, [vS, vK, vY], 'LineWidth', 2);
legend({['Sine Signal'], ['Gaussian Kernel'], ['Convolution Result']});


The result is given by: