# how to find breakpoints of a signal based on the frequency of the signal

There are 4 cos signals with 10,20,30 and 100 Hz each. The main signal is the sum of those 4 and I have to create a low pass filter, on the main signal for the frequency's > 50 Hz.

% design of low pass filter
f = [0 0.6 0.6 1];
m = [1 1 0 0 ];
b = fir2(30, f, m);
[h, w] = freqz(b,1,128);

hold on;
plot(f,m,'b')
plot(w/pi, abs(h), 'r')
ylabel('Magnitude')
legend('Ideal', 'fir2 designed')
legend boxoff
title('comparison of frequency Response Magnitytes');
hold off;


That's the example code that our professor gave us.On maltab using help fir2 there is a similar example

% Example 1:
%   Design a 30th-order lowpass filter and overplot the desired
%   frequency response with the actual frequency response.

f = [0 0.6 0.6 1];      % Frequency breakpoints
m = [1 1 0 0];          % Magnitude breakpoints
b = fir2(30,f,m);       % Frequency sampling-based FIR filter design
[h,w] = freqz(b,1,128); % Frequency response of filter
plot(f,m,w/pi,abs(h))
legend('Ideal','fir2 Designed')
title('Comparison of Frequency Response Magnitudes')


What i don't understand is how to find the frequency breakpoints and the magnitude breakpoints? Also whats the relation of the filter order with the low-high, band filters?

In any case, the Example 1 example's f = [0 0.6 0.6 1] and m = [1 1 0 0], vectors specify that the lowpass filter's "ideal" passband gain is one at $0*f_s/2$ Hz and is one at $0.6*f_s/2$ Hz. (The '*' symbol means multiply.) So the "ideal" lowpass passband extends from $0*f_s/2$ -to- $0.6*f_s/2$ Hz. The code also specifies that the lowpass filter's "ideal" stopband gain is zero at $0.6*f_s/2$ Hz and is zero at $1*f_s/2$ Hz. So the "ideal" stopband extends from $0.6*f_s/2$ -to- $1*f_s/2$ Hz.
Now if you wanted the filter's "ideal" lowpass passband to extend from $0*f_s/2$ -to- $0.5*f_s/2$ Hz (zero Hz –to- $f_s/4$ Hz), you would define vector 'f' as f = [0 0.5 0.5 1].