Storage write and pwm function

Hello. Im very new to this arduino world but I know that can be done amazing things. My intencion is to make an tone variable with pwm function (I have a nano arduino and I think is from the 13 pin to work) and want to someone to tell me if I can also grab it the output that is been passed thru a filter circuit in an sd card for later analisis. Is very important if someone knows if this can be done in any way. Thanks in Advance.

instead of the output of the signal, you might capture the generation code, which comes down to a collection of
durations and frequencies.

music = { (duration, freq)* }