# Confused over Stopband attenuation and stopband ripple

I have designed this bandstop filter to a desired specification:

Stopband attenuation = 40db Passband ripple = 2db etc ...

I understand that the stopband ripple can be given by the following:

Stopband ripple = −20log10(δs) 40 = −20log10(δs) δs=0.01

therefore stop-band ripple δs = 0.01. where I am confused is how this value can be converted into dB so that it can be compared to the stop-band ripple seen in the MATLAB simulation (which is in dB). 40dB is the stopband attenuation, not the stopband ripple (or is it?). the simulation is showing a stopband ripple of around 32dB.... is the stopband attenuated and ripple with same ? what am I missing ?