how do I calculate SNR of noisy signal? I am having problems in understanding how to do it practically

I have a wav file that contains pure speech and another ave file that just contains the background noise (can be various things, such as white noise, crowd noise, a recording of blowing wind, etc). These are either purely speech or purely noise. So I suppose I can get an SNR value from them by simple division of corresponding samples (or the average of a frame of samples) in both files. I then combine them in audacity to get a noisy speech file. I am guessing this file will still have the same SNR.

Now I pass this file through my noise reduction program and get another file as a result. How do I calculate the SNR of this "noise reduced" file?

--- EDIT ---

follow-up question posted HERE
The common definition of SNR is the power of the wanted signal divided by the noise power. Suppose you have obtained the wanted and the noise signal as arrays, calculation of the SNR in Matlab before noise reduction can be done like this:

snr_before = mean( signal .^ 2 ) / mean( noise .^ 2 );
snr_before_db = 10 * log10( snr_before ) % in dB


After noise reduction, the residual noise can be calculated as the difference of the wanted signal and the actual signal. Calculation of SNR is then straightforward:

residual_noise = signal - noise_reduced_signal; 
snr_after = mean( signal .^ 2 ) / mean( residual_noise .^ 2 ); 
snr_after_db = 10 * log10( snr_after )