I am pulling my hair out trying to write a lowpass filter for audio.
Being an audio engineer not a programmer this is totally alien to me, I have just about got the hang of using Matlab and now I'm being asked to write code!!
This is what I've written so far. If any kind person can help I'd be very grateful.
% Low Pass Filter at 1 kHz.
cutoff = 1000 / (fs/2);
% identifies all frequencies below 1000Hz
below_cutoff = spectrum(1:cutoff);
changed_spectrum = [below_cutoff;zeros];
I know it's probably complete garbage (it certainly doesn't work) but am I anywhere near on the right track? I just don't get it.
Being an audio engineer not a programmer this is totally alien to me, I have just about got the hang of using Matlab and now I'm being asked to write code!!
This is what I've written so far. If any kind person can help I'd be very grateful.
% Low Pass Filter at 1 kHz.
cutoff = 1000 / (fs/2);
% identifies all frequencies below 1000Hz
below_cutoff = spectrum(1:cutoff);
changed_spectrum = [below_cutoff;zeros];
I know it's probably complete garbage (it certainly doesn't work) but am I anywhere near on the right track? I just don't get it.
Last edited: