FIR Filter Quantization

Medium MATLAB DSP
Solve this problem

Quantize FIR filter coefficients to fixed-point Q15 format in MATLAB. The output must be integer values representing quantized coefficients.

Constraints

  • Input vector of floats.
  • Multiply by 32768.
  • Round to nearest.
  • Saturate to [-32768,32767].
  • Return int16 vector.
Starter codeMATLAB
1function q = fir_quant(h)2% TODO3end