f



How to easily get frequency response in Matlab from H(Z)?

Thanks,

0
yijun_lily (32)
2/6/2007 7:41:14 PM
comp.dsp 20333 articles. 1 followers. allnor (8509) is leader. Post Follow

1 Replies
552 Views

Similar Articles

[PageSpeed] 3

In article <1170790874.192175.89870@a75g2000cwd.googlegroups.com>, 
yijun_lily@yahoo.com says...
> Thanks,
> 
> 
The easiest way is to use the freqz function, found in the matlbal 
signal processing toolbox.
If you have the polynomial coefficients of both numerator and 
denominator of your h(z) function, respectively num and den, typing 
freqz(num,den) will plot H(f) in module and phase.
Hope this helps.
0
2/6/2007 5:02:24 PM
Reply:

Similar Artilces:

How can I get Frequency Response from Impulse Freponse In Matlab?
Hi! I want to get FRF of IIR Filter from Impulse Response. So, I got FRF using two method. One is FREQZ, another is FFT of impulse response. But two results are different. Why? My source code are below : clear all close all clc fs=2048; % Sampling Frequency N=65536; % Buffer Size t=[0:N-1]'./fs; % Time f = [0:N/2]'*fs/N; % Frequency x = zeros(N,1); % Impulse Input Signal x(1)=1; % 1 pole butterworth highpass filter with 2.7 Hz Cutoff [B, A] = butter(1, 2*2.7/fs, 'high'); [h, f] = freqz(B, A, N, fs); h = abs(h(1:N/2+1)); h_mag = 20*log10(h); f = f(...

Calculate frequency response of Z transform with known frequency bins
Hi all, I've been searching for the best way to do this programmically, but I can't seem to come up with a simple solution. I have a program that calculates filter coefficients correctly based on this z-transform: H(z) = (b0+b1*z^-1+b2*z^-2)/(1+a1*z^-1+a2*z^-2) I want to be able to display the magnitude response of this filter from 20Hz-20kHz at specified frequencies (48pts per octave) which I already have defined. Basically, I want to be able to pass in a frequency, lets say 250Hz, and be able to return a value based on what the filter is doing magnitude wise at that frequency assuming the sampling rate is 48kHz. Any help would be appreciated. Thanks, Dave davidrhunt@gmail.com wrote: > Hi all, > > I've been searching for the best way to do this programmically, but I > can't seem to come up with a simple solution. > > I have a program that calculates filter coefficients correctly based > on this z-transform: > > H(z) = (b0+b1*z^-1+b2*z^-2)/(1+a1*z^-1+a2*z^-2) > > I want to be able to display the magnitude response of this filter > from 20Hz-20kHz at specified frequencies (48pts per octave) which I > already have defined. Basically, I want to be able to pass in a > frequency, lets say 250Hz, and be able to return a value based on what > the filter is doing magnitude wise at that frequency assuming the > sampling rate is 48kHz. > > Any help would be appreciated. > > Thanks, > Dave &g...

Frequency response from impulse response in Matlab 7.0 simulink
Hi, I would like know how can I get frequency response from impulse response of a transfer function, let say 1/s+1 in Matlab 7.0 simulink. I would want to have a bode plot.What blocks am I suppose to use and what are the configuration? Thanking you in advance.. mkugan80 wrote: > Hi, I would like know how can I get frequency response from impulse > response of a transfer function, let say 1/s+1 in Matlab 7.0 simulink. I > would want to have a bode plot.What blocks am I suppose to use and what > are the configuration? Thanking you in advance.. You seem to call 1/(s + 1) -- surely ...

Matlab-Frequency Response
I write [num,den]=invfreqz(tf(1:50001),f,3,3) to compute my num and den of my transfer function(tf). Then, from the num and den that I obtained, I compute my approximated frequency response using fvtool(num,den). But this computed frequency response does not match my measured response. I do not know what goes wrong. Can someone help me? Thank you. ...

How to get the frequency response of a spline interpolator
Hello Everyone, Does anyone know as to how do we get a frequency response of a spline interpolator Basically i want to get a frequency response of the 1/2/3rd order spline interpolator for a sampling frequency of 20Mhz. I have been reading through a lot of materials showing the frequency responses but I wasnt able to generate one If any one could help here , could be great ...

why the "response" in h.get() ?
Hi, I found out, that getting data via h = Net::HTTP.new(stuff) resp, data1 = h.get(morestuff) only works, when the "resp" is there. Why is that, and what does the notation with the comma (",") mean ? I own the Ruby In A Nutshell, but it does not help much on this subject. greetings, BXS Parallel assignment: a, b = 1, 2 # a==1 b==2 c = [3, 4] a, b = c # a==3 b==4 http://www.ruby-doc.org/docs/ProgrammingRuby/html/ tut_expressions.html#UC Sincerely, Gennady Bystritsky On Nov 18, 2003, at 4:22 PM, Boris "BXS" Schulz wrote: > Hi, > > I found out, t...

Frequency Response VS FFT for measring frequency response of a audio ouput signal.
We have purchased the Sound and Vibration Toolkit and I have some questions. &nbsp; From the frequency response example I looked at you measure the input then the ouput and the Vi gives you the difference. &nbsp; I want to measure the audio frequency response a radio.&nbsp; So all I have is the output I dont have the audio input &nbsp;to use as a reference.&nbsp; How would I measure frequency response with the frequency rasponse&nbsp;VI with only the output audio signal? &nbsp; I was also looking at the FFT example to measure the audio signal frequency response. But from what I can tell so far this only does 1 channel I want to do both channles at the same time. Is there a way to do FFT on 2 channels at once and have them output on the same graph? &nbsp; Thanks for any help you can provide. &nbsp; ...

How to calculate frequency response of a lattice structure in Matlab?
Many stages, is there any easy way to get the response? On Feb 6, 2:47 pm, "yijun_l...@yahoo.com" <yijun_l...@yahoo.com> wrote: > Many stages, is there any easy way to get the response? Depending on the type of lattice filter you have (FIR, IIR), the various forms of the latc2tf() function will convert the lattice filter reflection coefficients and ladder taps into the equivalent numerator/denominator coefficients that you would use in a direct-form implementation. You can then pass these values into freqz() to see the frequency response. Jason yijun_lily@yahoo.com wrote: > Many stages, is there any easy way to get the response? Why not get the impulse response and calculate the FFT of that. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "We can build a better product than Linux" -- Microsoft Corp.'s Windows operating-system chief, Jim Allchin. One has to wonder why, with their huge resources, they haven't. ...

Getting a transfer function from frequency response data?
I have the gain and phase data for which I want to find a transfer function. None of the results that I get using "invfreqs" really matches the actual bode plot of the data. Any ideas? I also get the warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 4.362258e-030. Thanks! ...

Measuring frequency response with Matlab and a DAQ card ?
Hello, I am using a PC with Matlab R2006b (incl. Real Time Windows Target and Signal Processing TB) and a DAQ card (NI PCI-6024e) as a Rapid Control Prototyping System. I would like to measure the frequency response of some filters. Does anybody know, if there is a possibility to perform an automated frequency response measurement with Matlab? Especially, I wonder how to determine automatically the attenuation and phase shift between input and output signal. THX, Matthias ...

Using Matlab to elegantly calculate frequency response
Another question related to my low-pass filter. Basically, I can calculate the frequency response of the circuit, one frequency at a time, using Matlab; what I can't figure out is how to use this method to calculate the response for a whole bunch of frequencies at once. Maybe someone can help me out. Here are the calculations for a single frequency at a time: EDU>> % The circuit analysis calculations are: EDU>> % (Vin - V2)/R2 + (Vout - V2)/c2 = (V2 - Vout)/R4 EDU>> % (V2 - Vout)/R4 = Vout/c1 EDU>> % Re-arranging.... EDU>> % V2*(-1/R2 - 1/c2 - 1/R4) + Vout*(1/c2 + 1/R4) = -Vin/R2 EDU>> % V2*(1/R4) + Vout*(-1/R4 - 1/c1) = 0 So the goal is to set up a matrix: Vm * V = Vr, and then calculate: V = inv(Vm) * Vr. Again, for a single frequency: EDU>> f=2500; EDU>> w=2*pi*f; EDU>> R2=330; EDU>> R4=1000; EDU>> c1=1./(j.*w.*470e-9); EDU>> c2=c1; EDU>> Vin=1; EDU>> Vm = [(-1/R2 - 1/c2 - 1/R4) (1/c2 + 1/R4) ; (1/R4) (-1/R4 - 1/c1)]; EDU>> Vr = [ -Vin/R2 ; 0 ]; EDU>> V=inv(Vm)*Vr; EDU>> abs(V) ans = 0.37972 0.050967 The second value for "ans" correctly matches the measured output from the circuit at f = 2500 Hz; it also matches the result if I use the following equation to calculate the output voltage: EDU>> % Some pencil and paper work then yields EDU>> % Vout = (Vin/R2) / [(R4/c1) * (1/R2 + 1/c2) + 1/c1 + 1/R2] So far, so good. And, wit...

HOW TO GET AMPLITUDE AND FREQUENCY FROM WAVE SIGNAL USING MATLAB
hii, i have a wave signal data in the form of time and phase. How do i get amplitude and frequency from it? ...

Frequency Response between SS coded by Matlab and Result in Time Domain
Hi All, I try to validate the frequency response of my state-space model with the result from time domain simulation. Let me tell you what I have done: 1. My state-space model (named ss_Mo) is coded by Matlab and it is MIMO (4 inputs, 4 outputs). To get the frequency response I use command >>bode(ss_Mo). Then I will get the 32 graphs (16 for gain in decibel, 16 for phase). Each input provides 4-gain and 4-phase curves. Q1.If I want to choose only one gain and one phase, how can I use command to select only the interesting curves and replot them? Gain should be in decibel and the range...

Output of variable known, impulse response is known, how to get input signal in matlab?
Hello all, I have an oxygen sensor that has reported back oxyge concentrations while moving in a yo-yo pattern through the ocean. I have a vector of oxygen concentrations (about 10000 entries or more) and a vector of corresponding time intervals (approximately constant every 2 seconds). I consider my o2 concentration the output signal y(t). I know the sensor responds exponentially, so we are assuming an impuls response h(t)=[1-(e^-t/tau)] where tau is our time constant ~ 24seconds. Can anyone out there suggest how I would go about solving for the initia input signal x(t)? I assume this can be done in matlab, perhaps the signa processing toolbox. Any help, references, comments are welcome. cheers, - Charlie Charlie wrote: > Hello all, I have an oxygen sensor that has reported back oxygen > concentrations while moving in a yo-yo pattern through the ocean. > > I have a vector of oxygen concentrations (about 10000 entries or more) , > and a vector of corresponding time intervals (approximately constant ~ > every 2 seconds). I consider my o2 concentration the output signal y(t). > > I know the sensor responds exponentially, so we are assuming an impulse > response h(t)=[1-(e^-t/tau)] where tau is our time constant ~ 24seconds. > > Can anyone out there suggest how I would go about solving for the initial > input signal x(t)? I assume this can be done in matlab, perhaps the signal > processing toolbox. > > Any help, referenc...

Frequency response, impulse response and fft
I'd like to compute frequency response functions (FRF) from impulse response functions (IRF). I thought that the Matlab fft function would do the job. However, it is not working as I expected. I wrote a script that computes the IRF of a 1-DOF mechanical system, storing it in a vector. Then, the FRF vector is found by fft-ing the IRF. However, when this result is compared with the analytical FRF vector, we see that the two vectors are very different. Please, could you help me to figure out the mistake I'm doing? The Matlab code is: clear all close all % System properties m1=1; k1=500; c1=5; wn1=sqrt(k1/m1); zeta1=c1/m1/2/wn1; wd1=sqrt(1-zeta1^2)*wn1; % Impulse response t=linspace(0,10,1000); h=1/m1*1/wd1*exp(-zeta1*wn1*t).*sin(wd1*t); % FRF from impulse response H=fftshift(fft(h)); Fs=1/(t(2)-t(1)); f=linspace(-Fs/2,Fs/2,length(t)); % Analytical FRF w=2*pi*f; G=1./(k1-m1*w.^2+sqrt(-1)*w*c1); % Results figure(1) semilogy(f,abs(H)/length(H),'-r',f,abs(G),'-b') legend('from IRF','analytical') grid xlabel('Freq. (Hz)') ylabel('abs(H),abs(G)') title('FRF') On Jul 16, 8:42 am, Joli <Joli.LeC...@gmail.com> wrote: > I'd like to compute frequency response functions (FRF) from impulse > response functions (IRF). I thought that the Matlab fft function would > do the job. However, it is not working as I expected. > > I wrote a script that computes the IRF of a 1-DOF mechanical system, > s...

Obtain frequency response from impulse response
Hello, My task: Compute frequency response (bode plot) from impulse response data. I've read this article (http://model.exponenta.ru/achx02.html) and write the Matlab code to realize the article's algorithm. Underscore: I have just experemental data not the transfer function in analytical form. Matlab code: %%%%%%%%%%%%%%%%%%%%%%%%CODE BEGIN%%%%%%%%%%%%%%%%%%%%%%%%% Tend=1000; fs=2100; % sampling rate t = 0:1/fs:Tend; % sampling instants N=length(t); input=[1;zeros(N-1,1)]; % modelling the obtaning impu...

ishandle(h) vs. try(get(h))
While trying to do some coding to identify handle variables in the base stack I noticed the following: >> a=0; >> aa=plot(0,1); >> ishandle(a) ans = 1 >> ishandle(aa) ans = 1 Okay, fine. 0 is the root handle so even though it isn't really a handle in my case, it is simply an integer and the ishandle function "thinks" it points to a handle. In fact, ishandle will return 1 (true) for any vector of 0's. In my case I was able to work around this by using the following, try(get(a)), fprintf('Handle Found\n'); catch, fprintf('N...

how to get an IO object for the response from an HTTP get?
Hi, I'd like to get an IO object instead of a string for the response of an HTTP get. I am using the Net/HTTP library but it seems to only want to give me a string. I have a situation where the response can be quite large and do not want the whole response to have to be in memory. Is it possible to get an IO object for the response without putting the whole response in memory? thanks, Tim On 7/27/06, Tim Olsen <tolsen718@gmail.com> wrote: > Hi, > > I'd like to get an IO object instead of a string for the response of > an HTTP get. I am using the Net/HTTP libra...

Frequency response of a mirror-image time response
Hello all, this is the first time to post. I have some sampled s-domain frequency response f of a continuous time system, which represents a time-response h(T_s), h(2 T_s)..., h(N T_s). So what is the frequency response for a mirror-image time response (i.e. h(N T_s) ... h(2 T_s), h(T_s)). I have no idea how to obtain. Is there anybody can help me? Thanks. Leon On Oct 9, 1:51=A0pm, "leonlei" <lei_l...@hotmail.com> wrote: > Hello all, this is the first time to post. > > I have some sampled s-domain frequency response f of a continuous time > system, which represents a time-response h(T_s), h(2 T_s)..., h(N T_s). S= o > what is the frequency response for a mirror-image time response (i.e. h(N > T_s) ... h(2 T_s), h(T_s)). I have no idea how to obtain. Is there anybod= y > can help me? > > Thanks. > > Leon Hello Leon, Welcome. Look up for fourier transforms the scaling property and the conjugation property. I think you can find the answer now. Hint the magnitude response will be unaffected. Clay ...

Get a result from Matlab to Java (Call Matlab from JAVA
Hi all, I am having trouble getting the return value from matlab to JAVA. I have tried Kamin Whitehouse 's code(matlabcontrol.java) and get working for eval and feval, but having trouble using blockingFeval function which returnts the value of matlab. The problem I am having is it returns some value valid only in matlab workspace and when I play around with the return value in matlab, it works fine but in Java program it is just junk data. I corresponded with Kamin and he thinks that jmi.jar has been changed since he developed the class. The matlab library now returns the handle of the data, and not the data itself. Anybody has a clue of handling this problem? Thanks ----------------------------------------------- I attached some results regarding this problem > In blockingFeval function in matlab control > > public Object blockingFeval(String command, Object[] args) throws > InterruptedException { > returnVal=new String("noReturnValYet"); > Matlab.whenMatlabReady(new MatlabBlockingFevalCommand(Command, args, > useCb, this); > if(returnVal.equals(new String("noReturnValYet"))) { > synchronized9returnVal) { > returnVal.wait(); > } > } > //**********no change above this point ********** > System.out.println("returnvalue in matlabcontrol : " + > returnVal.toString()); > Object rets[]=new Object[1]; > rets[0]=returnVal; > try { > ...

Sending a GET request and getting the response using fsockopen.
Hi, I need to use fsockopen to open a connection, send a GET request and read in the response. At the moment I'm trying the following code, but I think it's ignoring the actual URL included in the $request variable. $host = "www.myhost.com"; $request = "/myurl.php?param1=1&param2=2&param3=3"; $fp = fsockopen($host, 80, $errno, $errstr, 3.0); if ($fp) { # Send the get request then, with timeout... fwrite($fp, "GET / HTTP/1.0\r\n" . "Host: $host\r\n". "Connection: close\r\n". "Content-Length: " . strlen($request) . "\r\n" . "\r\n" . $request); stream_set_timeout($fp, 2, 0); $response = ''; while (!feof($fp)) { $response .= fread($fp, 1024); } print $response . "<BR>\n"; fclose($fp); } What am I doing wrong? Thank you!! On Tue, 30 Jan 2007 03:36:36 -0800, Aetherweb <jeffsnox@gmail.com> wrote= : > Hi, > > I need to use fsockopen to open a connection, send a GET request and > read in the response. At the moment I'm trying the following code, but= > I think it's ignoring the actual URL included in the $request > variable. > > $host =3D "www.myhost.com"; > $request =3D "/myurl.php?param1=3D1&param2=3D2&param3=3D3"; > > $fp =3D fsockopen($host, 80, $errno, $errstr, 3.0); > > if ($fp) > { > # Send the get request...

Numerically Computing Impulse Response from Power Frequency Response
I am trying to compute the impulse response of a given channel to include in a BER analysis. I have the power transfer function of the channel, not the classical amplitude/phase transfer function of the channel. Fortunately, the transfer function is symmetric, so I can numerically calculate the impulse response as: amp_freq_resp = sqrt(power_freq_resp); imp_resp = ifft(amp_freq_resp); imp_resp = real(imp_resp); The final command simply removes the imaginary portion of the impulse response, as it is only an effect of the IFFT calculation in MATLAB. The square root can be used because the transfer function, so the impulse response will be purely real. This is where the problem arises. The power transfer function is near Gaussian, and so is the amplitude transfer function. This would imply that the impulse response should be near Gaussian. However, because I am taking a finite length IFFT, the impulse response is a Gaussian convolved with a very high frequency sinc function. So I get a Gaussian envelope with alternating positive and negative values in my impulse response. Of course, this sort of impuse response is terrible for certain modulation types. My question is, can I simply calculate the envelope of the impulse response and use that as the impulse response in my BER analysis? If not, is there any method that I can use to easily remove the effects of the finite-length IFFT from the impulse response? Thanks, Susheem susheemg@yahoo.com wrote: > I am trying ...

How to calculate impulse response from frequency response data by IFFT??
Hello, &nbsp; i want to&nbsp;calculate the impulseresponse from complex frequency-response data. My problem is, that for the first ten frequnency responses my frequency response is very bad. But i can�t cut these values out of my complex array coz if i do so the sampletime doesn�t fit anymore to my frequency response. What can i do?? &nbsp; greetings, &nbsp; RRapha &nbsp; ...

frequency response
Dear All, I have a question regarding frequency response. I have some data and can plot frequency response from that. Now I would like to get transfer function from that data or graph, Is there any way to get transfer function automatically? Your suggestion could be of great help. Thankyou With Regards Alam Alam wrote: > Dear All, > > I have a question regarding frequency response. I have some data and > can plot frequency response from that. Now I would like to get > transfer function from that data or graph, Is there any way to get > transfer function automatically...

Web resources about - How to easily get frequency response in Matlab from H(Z)? - comp.dsp

Frequency - Wikipedia, the free encyclopedia
Three cyclically flashing lights, from lowest frequency (top) to highest frequency (bottom). For each light, "f" is the frequency in hertz (Hz) ...

Frequency - Wikipedia, the free encyclopedia
Three cyclically flashing lights, from lowest frequency (top) to highest frequency (bottom). For each light, "f" is the frequency in hertz (Hz) ...

Bloomberg Pursuits Increases Publishing Frequency
Bloomberg Pursuits, a magazine for extremely wealthy people, has increased its publishing frequency to six times per year. Each new issue of ...

What is CPU frequency scaling?
One of the most important (and obvious) characteristics of mobile computing is that mobile devices use batteries rather than being plugged into ...

Twitter Unveils New ‘Trust and Safety Council’ Featuring Feminist Frequency
Twitter has announced a new “Trust and Safety council” for the service, including controversial web series Feminist Frequency.

ZTE and China Mobile Jointly Announce Latest 5G High-Frequency Prototype
Business Wire (press release) ZTE and China Mobile Jointly Announce Latest 5G High-Frequency Prototype Business Wire (press release) SHENZHEN, ...

Experimental Study Shows Marijuana Slashes Frequency Of Migraines
Experimental Study Shows Marijuana Slashes Frequency Of Migraines

What goes up must come down. Except the frequency of New Year's celebratory gunfire: GunFAIL CLXXIV
Wow, what a week! By now you’ve noticed that the hunting accidents are on the decline, but longtime followers of GunFAIL know very well that ...

Riley Smith To Star In the CW’s ‘Frequency’ Reboot
Riley Smith ( Nashville, True Detective ) is set as the male lead in Frequency , the CW’s drama pilot based on Toby Emmerich's sci-fi thriller. ...

Feminist Frequency makes new Twitter Trust and Safety Council
I love Twitter . to celebrate.... bringing back a classic....been a while since one of these bad boys... pic.twitter.com/Zyn5y5lRhl — your welcome ...

Resources last updated: 3/30/2016 12:40:47 AM