Add coriander seeds and toast for 4-5 minutes until they've darkened and released their aroma. Remove from the pan and let cool.
Add fennel seeds and toast for 1.5-2 minutes. Remove from the pan and let cool.
Toast cumin seeds for just under a minute until they have darkened. Remove from the pan and let cool.
Add the whole spices and toast for 2-3 minutes. Remove from the pan and let cool.
Transfer the cinnamon stick, star anise, nutmeg and allspice berries to a grinder and press a few time to break them. Then add the rest of the spices and grind to a fine powder.
Store in an airtight container in a dry place.
Notes
The above quantities yield about 25g garam masala.
If you don’t want to pre-toast the spices, you can grind them raw but then add the seasoning early in the cooking so that the spices have time to cook.