How do I comment the code I wrote for a course I am lecturing in? I am an assistant professor for a course on audio signal processing (for engineers) and I often write snippets of code to try to help the students follow the material. In addition, I get to lecture (1) one session of the course. 

I have a lot of code I wrote over the last couple of years for this particular session but I realized my comments on it are not consistent at all and I have not found any sort of standards or guidelines for pedagogically appropriated commenting style. 

Should I comment this code like I normally do with any code? 

I usually add a header comment explaining which course the code was written for and something about what it is showing. But I also tend to comment the code with some trivialities in order to state somethings that I think would be obvious to developers but not to engineering students.
I think the Linux kernel is a good standard.

In general, don't explain what are you doing, that should be obvious from the code. Do tell why you are doing it. Let me show an example:

data_padded = pad_with_zeroes(data, 2**ceil(log2(len(data))))
fft(data_padded)


Everybody can see that I am padding it with zeroes, and any engineer student should see I am doing it to the next power of two (modulo bugs). But they may not be aware why are you doing it: a comment should point out that a FFT is fastest when the input length is a power of two.

Also, since this is a very technical setting, add the full names of the algorithms, with alternative names if they are common, and at least a reference using the same definition as you are. Tracking down factors of 2 π can be a pain.