I believe what you are asking for is a filter $\mathbf{h}$ and modulation $\mathbf{y}$ such that $(\mathbf{x} \circ \mathbf{y}) \ast \mathbf{h} = c \mathbf{1}$, where $c$ is a constant and $\mathbf{1}$ is a vector of all $1$'s. The $\ast$ operator is convolution and $\circ$ is modulation (aka Hadamard/Schur product).
The signal is of the form, $\cos( 2\pi f_0 n / f_s + \phi)$, where $f_0$ is the frequency of the wave, $f_s$ is the sampling frequency, $\phi$ is some phase offset, and $n=0,1,\dots$. Since the length of the filter is $1/4$ of the period of the signal, we know that $4N_{filt}/f_s=1/f_0$, or that $4N_{filt}f_0 = f_s$. Also, the value of $\phi$ is unimportant since it does not change sample-to-sample, so we can assume it's zero.
There are three ways to get a constant value out of the filter/modulation. The first is to remove all energy in the signal. The second is to shift all of the signal's energy to DC. The third is shift some of the energy to DC and remove the rest.
To accomplish the first of these, all you have to do is let $\mathbf{y}=\mathbf{1}$ and design $\mathbf{h}$ such that all the energy at the frequency $f_s/(4N_{filt})$ is removed. This could be done with a highpass, lowpasss, or a notch filter, though I think it will be easiest in this case to use a highpass since the frequency of interest is close to DC.
The second method of shifting all the energy to DC is not doable in this case -- at least with a linear process. The magnitude of the spectrum of the input signal is of the form $\delta(f - fs/(4N_{filt})) + \delta(f + fs/(4N_{filt}))$. Any modulation that put one of these spikes at DC would shift the other to $\delta(f \pm fs/(2N_{filt}))$.
The third method is to shift one of the spikes in the spectrum down to DC and then just filter out the other one with a lowpass filter. The shift could be accomplished with $\mathbf{y} = e^{j2\pi n / (4N_{filt})}$ and the cutoff frequency of the filter would then need to be $f_s / (2N_{filt})$ or lower.