I cut the plywood about 5/8 of an inch smaller than the area
it was to be sandwiched in between. One opening was 12 x 42
inches, so I made the board 11 and 3/8 x 41 and 3/8 inches.
This was to leave enough room so that the carpet could be
wrapped around the wood and still fit between the rails.
Once each of the boards was cut, I cut out a couple of 3 x
16 in strips of carpet. I wrapped the boards with the strips
of carpet to test the fit. You want a snug fit, but you don't
want to have to force the board in. You may need to trim the
board a little more depending on the thickness of your carpet.
Next, I cut the carpet leaving about 4-5 inches of overhang on
all sides. For the 12 x 42 inch board, I cut out a piece of
carpet about 22 x 50 inches. It doesn't have to be perfect
since it will be hidden. Once I had a piece of carpet that
was about the right size, I cut a triangle off of each corner.
This allows you to fold and staple the carpet without overlap.
I used a standard home-use staple gun to secure the carpet
to the plywood.