The phenomenon you are asking is very complex because, in contrast to an aircraft, the piston is moving back an forth, which means that the air flow is fully turbulent.
That being said, I imagine that the discontinuity in pressure would be caused by sudden changes in the direction of the airflow, caused by the alternating pressure between upstroke and downstroke.
For an aircraft, these are the equations:
http://www.grc.nasa.gov/WWW/k-12/airplane/normal.html
http://www.grc.nasa.gov/WWW/k-12/airplane/oblique.html
For a piston, unless you can find something in a book that I am not aware of, you would have to solve the Navier-Stokes with turbulence to see when the shock waves are formed.
A rough approximation is to consider a plane that is moving in one direction in a container where the air is moving in the other direction. If you solve the equations, you will get when the Mach number becomes greater than 1, as a function of the displacement of the piston. This value will depend on the relative velocity between the air and the piston, as well as the geometry you assume.