Correcting a small bug: filter2d performs convolutions instead of filterings, therefore the filters had to be reversed to obtain the same results. Added the code to write the data into .dat format.