The two possible ways to collect katanas are:
Using steel orbs to generate Katanas
Using Phantom mode to generate Katanas
I highly suggest using the steel orb method to generate Katanas. On stage one, hold down and get close to enemies to collect steel orbs. You can tell how many orbs you currently have by the number of circles lit up around your ship and make sure all circles have lit up. Once you get to the boss fight enter phantom mode with and shoot all steel orbs at the boss with . If all orbs hit you will earn Katana of Justice and generate 16 Katanas. Press to exit phantom mode and shoot your katanas at the boss. If all of them hit you will earn Katana of Truth.