Advancing the State-of-the-Art of Microwave Astronomy: Novel FPGA-Based Firmware Algorithms for the Next Generation of Observational Radio and Sub-millimeter Wave Detection