From: chris on
I am new to the signal processing toolbox. Trying to do something pretty simple, but having spent all day hunting around on the web and mathworks can’t find the answer.

I have a function, which generates a signal by filtering a timeseries. I would like to plot the magnitude response of the filter (using freqz.m or freqs.m) and thus allow me to visually observe how changing the parameter values in the conf file alters the transfer response of the filter

The function is of the form:

function signal = myFunc(ts1, ts2, conf)
%ts1 and ts2 are vectors
%conf is an struct passed in containing all the parameter values for the filter

signal = (conf.a1*ts1 + conf.a2*ts1 + conf.a3* ts1) * (conf.b1*ts2 + conf.b2)
end

Can anyone help me understand what a call to the freqz or freqs function looks like?? I guess it will be something like

Q = [a1 a2 a3];
freqs(Q,1, linspace(1/7,1/100));
(where 7 are 100 is the range of periods i want to look at the response over).

Many Thanks!!!
From: chris on
two further points:

1. I wish to generated a Normalized frequency response (Nyquist==1)

2. I have had a look at pwelch.m as well, as i think this could be used to plot a non-normalized frequency response (as per the below example from stackoverflow.com)

Fs = 100;
Tmax = 10;
time = 0:1/Fs:Tmax;
omega = 2*pi*10; % 10 Hz
signal = 10*sin(omega*time) + rand(1,Tmax*Fs+1);
Nfft = 2^8;
[Pxx,freq] = pwelch(signal,Nfft,[],[],Fs)
plot(freq,Pxx)