def forward_4n(self, x):
        """DCT type II - reduction to FFT size 4N."""
        assert self.N == x.shape[-1]
        z = x.new_zeros(x.shape[:-1] + (1,))
        x = torch.cat([x, z, -x.flip(-1), -x[..., 1:], z, x[..., 1:].flip(-1)], dim=-1)
        y = torch.fft.ifft(x)
        y = y[..., 1:2*self.N:2]
        if torch.is_complex(x):
            return y
        else:
            return torch.real(y)
DCT type II - reduction to FFT size 4N.
analyze/convnexts4nd/src/models/nn/dxt.py