title: How to perform 1-dimensional "valid" convolution?
body: <p>I'm trying to implement a 1-dimensional convolution in "valid" mode (Matlab definition) in C++. </p>
  
  <p>It seems pretty simple, but I haven't been able to find a code doing that in C++ (or any other language that I could adapt to as a matter of fact). If my vector size is a power, I can use a 2D convolution, but I would like to find something that would work for any input and kernel. </p>
  
  <p>So how to perform a 1-dimensional convolution in "valid" mode, given an input vector of size I and a kernel of size K (the output should normally be a vector of size I - K + 1). </p>
  
  <p>Pseudocode is also accepted. </p>