MATLAB Freqz: Plotting Frequency Response Up to W=100

  • MATLAB
  • Thread starter LM741
  • Start date
  • Tags
    Matlab
In summary, the conversation is about getting a frequency response of a discrete signal using the MATLAB function "freqz". The problem is that it only plots up to 1 rad/sec, which is a normalized frequency. The user needs it to plot up to 100 rad/sec to compare it with a continuous signal and analyze any aliasing. They have tried changing the values of N and Fs, but without success. The expert suggests using "freqz(znum,zden,[],100)" to see the repetitions in the spectrum, and also provides a way to customize the range of frequencies using a vector. The conversation ends with the user thanking the expert and expressing their frustration with not being able to see the desired frequency response.
  • #1
LM741
130
0
hey guys .
i have this discrete signal : z/(z-(e^-2T))

and i want to get a frequency response of it...

i use the matlabe function : freqz

but the problem is that it only plots up to the angular frequency of 1! i.e. its a normalized frequency...

does anybody know how i can make it plot up to w =100 for example?
i need to do this so i can compare it to my continuous signal and analyze any alising that may occur..

thanks
John
 
Physics news on Phys.org
  • #2
Learn to use the function by typing "help freqz" at the prompt.
You'd then see that FREQZ(B,A,N,Fs) will display the spectrum in the frequency axis scaled to the sampling frequency (Fs).
 
  • #3
thanks - i did try that first; this post was my second alternative.

i kept changing the values of N and Fs but did not get the right results. something is missing - i was hoping somebody that knows MATLAB well could tell me.
 
  • #4
Well, what is the sampling frequency Fs? For N, try setting it to a big number, like 2^10, for better frequency resolution.
 
  • #5
please help

sup doodle - okay I've played around some more but without achieving much success. I've attahed the frequency responses i got for my discrete signal with teo different sampling periods. As you can see, it only plots the normailized frequncey (upto 1rad/sec) but i really need it to plot upto at leat 100rad/sec(as with the continuous signal frequency response) this is so i can observe any repetition of the sampled signal. hope you or some one can help me

thanks very much
John
 

Attachments

  • sampling.doc
    50.5 KB · Views: 377
  • #6
Hmm... you need to understand that discrete-time signals do not appreciate the notion of sampling time. If you are convinced that your sampling frequency is 100Hz, then you should use "freqz(znum,zden,[],100)" instead.

And please understand also that spectrums of discrete-time signals are periodic and what is shown (by freqz) is only one-half period of the spectrum. If you were thinking of looking at the spectrum beyond the 1Hz and expecting to find something other than what is contained in this one-half period, then you are gravely mistaken.
 
  • #7
i am well aware of the fact thet a frequncy responce of a sampled signal will be periodic...you seem to keep missing my point/dilema. I need to see these repetitions - i.e. i want to see the effect of my frequency response with various sampling periods. So i DO want a spectrum over 1Hz! i will find something other! - i will be able to observe the level of severity of aliasing with different sampling periods!

thanks anyway
 
  • #8
The DTFT of a system can be calculated from the transfer function using freqz. Define the numerator and the denominator of the transfer function in num and den. The command
[H,Omega] = freqz(num,den,n,'whole');
computes the DTFT for n points equally spaced around the unit circle at the frequencies contained in the vector Omega. The magnitude of H is found from abs(H) and the phase of H is found from angle(H). To customize the range for ohm, define a vector Omega of desired frequencies, for example Omega = -pi:2*pi/300:pi defines a vector of length 301 with values that range from -pi to pi. To get the DTFT at these frequencies, type

H = freqz(num,den,Omega);
 
  • #9
Well okay, if you want to observe beyond the 1Hz, then do this:
freqz(znum,zden,linspace(0,3,100),1)
which gives a plot upto 3Hz with 1Hz as the sampling frequency, i.e., you'd be looking at three period of the spectrum.
 

Related to MATLAB Freqz: Plotting Frequency Response Up to W=100

1. What is the purpose of using MATLAB Freqz to plot frequency response?

MATLAB Freqz is a tool that allows you to plot the frequency response of a system, which is the relationship between the input and output signals at different frequencies. This can help you understand how a system will behave when it is exposed to different input frequencies.

2. How do I specify the range of frequencies to be plotted using MATLAB Freqz?

In order to specify the range of frequencies, you can use the 'w' parameter in the MATLAB Freqz function. For example, if you want to plot frequencies up to 100, you would use the command 'freqz(b,a,w)' where 'b' and 'a' are the coefficients of the system and 'w' is set to 100.

3. Can I plot multiple frequency responses on the same graph using MATLAB Freqz?

Yes, you can plot multiple frequency responses on the same graph by providing multiple sets of coefficients for the 'b' and 'a' parameters in the MATLAB Freqz function. This can be useful for comparing the frequency responses of different systems.

4. Can I customize the appearance of the frequency response plot in MATLAB Freqz?

Yes, there are several options for customizing the appearance of the frequency response plot in MATLAB Freqz. You can change the color and line style of the plot, add grid lines, and adjust the axis labels and limits. You can also add a legend to label the different frequency responses if you are plotting multiple on the same graph.

5. Can I save the frequency response plot generated by MATLAB Freqz?

Yes, you can save the frequency response plot in various file formats including PNG, JPEG, and PDF. This can be done by using the 'saveas' function in MATLAB after generating the plot using Freqz. You can also copy the plot to the clipboard and paste it into other applications for further editing or use.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
25K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
22K
  • Advanced Physics Homework Help
Replies
7
Views
1K
Back
Top