MATLAB Freqz: Plotting Frequency Response Up to W=100

  • Context: MATLAB 
  • Thread starter Thread starter LM741
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary

Discussion Overview

The discussion revolves around the use of the MATLAB function freqz to plot the frequency response of a discrete signal, specifically addressing the challenge of extending the plot beyond the normalized frequency limit of 1 rad/sec to a higher frequency, such as 100 rad/sec. Participants explore the implications of sampling frequency and the periodic nature of discrete-time signals in relation to aliasing analysis.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • John presents a discrete signal and seeks to plot its frequency response beyond the normalized frequency limit using freqz.
  • One participant suggests using the help function in MATLAB to understand freqz better and mentions the option to scale the frequency axis with the sampling frequency (Fs).
  • John indicates that despite trying different values for N and Fs, he is still unable to achieve the desired results.
  • Another participant recommends setting N to a larger value for better frequency resolution and asks about the sampling frequency Fs.
  • John expresses frustration, stating he needs to observe the frequency response over a range that includes repetitions to analyze aliasing effects.
  • A participant explains that discrete-time signals are periodic and that freqz only shows one-half of the spectrum, cautioning against expecting additional information beyond this range.
  • John acknowledges the periodic nature but insists on the necessity of seeing the frequency response over a broader range to evaluate aliasing severity.
  • Another participant describes how to compute the Discrete-Time Fourier Transform (DTFT) using freqz and suggests defining a custom frequency vector for the desired range.
  • One participant proposes a specific command to extend the frequency response plot to 3 Hz, indicating how to visualize multiple periods of the spectrum.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and implications of plotting frequency responses beyond the normalized limit. While some provide technical suggestions, John maintains that he requires a broader frequency range for his analysis, indicating a lack of consensus on the approach to take.

Contextual Notes

There are unresolved assumptions regarding the appropriate sampling frequency and the implications of periodicity in discrete-time signals. The discussion reflects varying interpretations of how to effectively utilize freqz for the intended analysis.

LM741
Messages
130
Reaction score
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
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).
 
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.
 
Well, what is the sampling frequency Fs? For N, try setting it to a big number, like 2^10, for better frequency resolution.
 
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

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.
 
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
 
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);
 
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
26K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
1
Views
23K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
6K