def forward_4n(self, x):
        """DCT type II - reduction to FFT size 4N."""
        assert self.N == x.shape[-1]
        x = torch.cat([x, x.flip(-1)], dim=-1)
        z = torch.zeros_like(x)
        x = torch.stack([z, x], dim=-1)
        x = x.view(x.shape[:-2] + (-1,))
        y = torch.fft.fft(x)
        y = y[..., :self.N]
        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