Looking for a simple and effective notch filter I ran a finite-difference simulation and the behavior of an output signal, $s$, in time, $t$ (sampled with period $\Delta t$) behaves approximately as in the figure below. It is well-described by a slowly-varying pulse plus a rapidly oscillating signal of the same envelope with lower amplitude.



For concreteness, I computed this sample signal in MATLAB with the following code.

f_noise = 20;
t = linspace(-4,4,2e3);
signal = exp(-t.^2);
noise = 0.25*exp(-t.^2).*sin(2*pi*f_noise*t);
signal_w_noise = signal + noise;


I emphasize that this is just a sample signal and not the actual data I want to analyze.

I wish to compute the "time-average" of the signal. By this I mean the signal without the rapidly oscillating component (which we could call noise). To get a clear picture of the problem, I calculated the Fourier transform of the signal approximately using MATLAB's fft function and obtained the spectra below.



From this plot, I suspect a notch-filter could do the trick. However, I know very little of signal processing and I know how to use first-order filters from undergraduate electric-circuit courses. What is a simple to use but effective notch-filter I could use? I am particularly looking for the transfer function in the frequency domain of such notch-filter, because the software I use to generate the data is equipped with a FFT algorithm, so I'd like to do the processing there and avoid exporting the whole data to, say, MATLAB.
i might also recommend a low-pass filter over a notch filter unless the OP is absolutely certain, in advance, what the frequency of the "noise" is.  if the OP has less information about the high-frequency noise that the OP desires to remove (leaving the moving average), then a LPF with DC gain of 1 (or 0 dB) and a cutoff frequency lower than the lowest expected frequency component in the noise is indicated.  not a notch filter.

whether it's a Kaiser-windowed-sinc FIR or an IIR LPF (perhaps a simple 2nd-order IIR suffices) is a design and performance issue.

but i would not recommend a notch unless it is known apriori that the "noise" is sinusoidal and what the frequency of the sinusoidal "noise" is.