tag:blogger.com,1999:blog-1693014329567144872.post8844345740264835618..comments2023-08-27T06:49:20.658+01:00Comments on The Glowing Python: How to plot the frequency spectrum with scipyJustGlowinghttp://www.blogger.com/profile/17212021288715206641noreply@blogger.comBlogger39125tag:blogger.com,1999:blog-1693014329567144872.post-65043705432162085512020-05-24T14:37:25.276+01:002020-05-24T14:37:25.276+01:00This is not a one sided spectrum, but rather just ...This is not a one sided spectrum, but rather just half of a 2 sided spectrum. You should multiply the remaining one-sided values by 2 to normalise to a one-sided spectrum (to preserve the energy of the spectrum).<br /><br />As f. sheng noted, its clear to see the resulting amplitudes in this plot are off by a factor of 2.<br /><br />Or maybe im missing something here?Jachttps://www.blogger.com/profile/01444611697798567602noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-62311524165618333062019-03-20T06:54:51.513+00:002019-03-20T06:54:51.513+00:00This post shares excellent resources. Great!
This post shares excellent resources. Great! <br />freya rikihttps://www.2basetechnologies.com/noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-13424113908319026992017-12-12T15:59:48.423+00:002017-12-12T15:59:48.423+00:00How to plot the psd using the given example?How to plot the psd using the given example?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-74863732739608777452017-05-16T15:11:33.197+01:002017-05-16T15:11:33.197+01:00This comment has been removed by the author.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-14033379414527082342017-02-07T08:49:27.711+00:002017-02-07T08:49:27.711+00:00You first need to parse the data. I recommend you ...You first need to parse the data. I recommend you to look into pandas.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-28060481158602086772017-02-07T08:25:15.834+00:002017-02-07T08:25:15.834+00:00How would this work if we had to feed bulk data in...How would this work if we had to feed bulk data in csv or txt format?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-49989481665653476912016-12-26T16:03:08.427+00:002016-12-26T16:03:08.427+00:00Thanks :)Thanks :)Anonymoushttps://www.blogger.com/profile/12041207057327552607noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-62082364165944411052016-12-26T15:58:39.463+00:002016-12-26T15:58:39.463+00:00Hi Ivana, you have to use the interactive mode, ha...Hi Ivana, you have to use the interactive mode, have a look here: http://matplotlib.org/users/shell.htmlJustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-84363122727849641372016-12-26T15:56:22.541+00:002016-12-26T15:56:22.541+00:00Python: How to plot a period of one square signal ...Python: How to plot a period of one square signal and press ENTER and second period shows on the same graph? Help please. :)Anonymoushttps://www.blogger.com/profile/12041207057327552607noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-26324497258091778422016-08-31T11:55:16.380+01:002016-08-31T11:55:16.380+01:00Very good information, thanks for sharing. Website...Very good information, thanks for sharing. <a href="http://www.zinavo.com/" rel="nofollow"><b>Website Design Bangalore</b></a> | <a href="http://www.zinavo.com/" rel="nofollow"><b>Web Designing Company Bangalore</b></a>Zinavo-Web Design | Web Development | SEO | Mobile Apps | ERP/CRMhttps://www.blogger.com/profile/13670387926878415387noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-82820373072699854912015-09-08T20:46:17.647+01:002015-09-08T20:46:17.647+01:00Amplitude is off by a factor of 2Amplitude is off by a factor of 2F. Shenghttps://www.blogger.com/profile/02994417483137102217noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-65434262254423535582015-02-08T15:32:22.412+00:002015-02-08T15:32:22.412+00:00Why does the fft distribution change with the leng...Why does the fft distribution change with the length of sound sample in SciPy?Anonymoushttps://www.blogger.com/profile/08675726597541022145noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-39736656592718338962015-01-09T16:31:03.302+00:002015-01-09T16:31:03.302+00:00Or just...
# Express FFT in the frequency domain....Or just...<br /><br /># Express FFT in the frequency domain. <br />def spectrum(signal, Time):<br /> <br /> frq = fftfreq(signal.size, d = Time[1] - Time[0] )<br /> Y = rfft(signal)<br /> <br /> return frq, YAnonymoushttps://www.blogger.com/profile/17497431632341549667noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-72396037488069092412014-12-02T17:32:55.138+00:002014-12-02T17:32:55.138+00:00hi, y must be an array. If your y is a function yo...hi, y must be an array. If your y is a function you need to sample it. n is the length of this array.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-76654330565994404302014-12-02T15:49:43.070+00:002014-12-02T15:49:43.070+00:00Thanks for the example!
One question though,
how ...Thanks for the example!<br />One question though,<br /><br />how can n=len(y) actually be calculated since y is a function? Also if I try to print n it says it's undefinied. But how is it possible to (finally) use it as the x axis?<br /><br />Thanks in advance!<br />JanAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-58671765772843365142014-06-28T18:27:26.483+01:002014-06-28T18:27:26.483+01:00Hi ,
I'd like to get quite the same analysis ...Hi ,<br /><br />I'd like to get quite the same analysis here to reproduce the spectrum while playing a wav file. Something like here : https://www.youtube.com/watch?v=Tmpl5KA02S4.<br />I just need to get the 8x8 matrix for each time (let's say each 1s) and I can manage the leds after that.<br /><br />If it doesn't bother you could you point out some code please ?<br />it about many days I couldn't end with something successful.<br /><br />ThanksMouhanoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-58899581833408972362014-01-09T04:06:55.671+00:002014-01-09T04:06:55.671+00:00I believe they are looking to slice the frequency ...I believe they are looking to slice the frequency spectrum there. The correct way to do this now is:<br /><br />frq = frq[1:n/2] # one side frequency range (sliced the frq in half)<br /><br />you will also have this problem with the Y values. It should be <br /><br />Y = Y[1:n/2]<br /><br />please correct me if i am wrongAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-66744672690734011142013-11-23T19:46:53.048+00:002013-11-23T19:46:53.048+00:00--------------------------------------------------...---------------------------------------------------------------------------<br />TypeError Traceback (most recent call last)<br /> in ()<br /> 32 ylabel('Amplitude')<br /> 33 subplot(2,1,2)<br />---> 34 plotSpectrum(y,Fs)<br /> 35 show()<br /><br /> in plotSpectrum(y, Fs)<br /> 11 T = n/Fs<br /> 12 frq = k/T # two sides frequency range<br />---> 13 frq = frq[range(n/2)] # one side frequency range<br /> 14 <br /> 15 Y = fft(y)/n # fft computing and normalization<br /><br />TypeError: 'float' object cannot be interpreted as an integer<br />Alistair Walshhttps://www.blogger.com/profile/12852010670770605693noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-83879120917131937312013-11-12T20:19:15.657+00:002013-11-12T20:19:15.657+00:00In the line """Y = fft(y)/n # fft c...In the line """Y = fft(y)/n # fft computing and normalization""", I don't understand why you divide by `n`. I would interpret that to mean that longer the duration of the signal, the smaller the amplitude values in `Y`. I would think you would want to divide by the max possible value for the amplitude data to nomalize it so it falls between 0 and 1.Anonymoushttps://www.blogger.com/profile/14800098071441058518noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-5481115769208228242013-07-01T08:39:59.152+01:002013-07-01T08:39:59.152+01:00Hi Black, you need the inverse Fourier Transform: ...Hi Black, you need the inverse Fourier Transform: numpy.fft.ifftJustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-64798473732973731842013-06-30T22:27:41.716+01:002013-06-30T22:27:41.716+01:00How would you reverse process. Start with frequenc...How would you reverse process. Start with frequency and amplitude information and then display the resulting pattern?<br />black_13https://www.blogger.com/profile/16676086803660525592noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-12005264655425881592013-03-17T19:02:04.264+00:002013-03-17T19:02:04.264+00:00I believe you want to filter your signal then ampl...I believe you want to filter your signal then amplify it. You can do it in real time without using any GPU.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-40236408116428454792013-03-17T18:06:32.329+00:002013-03-17T18:06:32.329+00:00This may be off the subject. I am trying to make a...This may be off the subject. I am trying to make a simple hearing aid. An audiologist maps the decibels at each frequency a person hears at. The decibel threshold for normal is less than 25 decibels. <br />- The simplest hearing aid would just amplify the sound to the equivalent 25 decibels.<br />- A slightly more complex system would amplify individual frequencies according to the hearing pattern of the individual. - Expensive ($3,000+) hearing aids can filter out background noise. <br />Hearing aids are very easily $2,000 per ear for the low end. Some go down to $350, but it is uncertain what they do. The elderly need hearing aids the most, but they are also the ones who can least afford it. They are rarely covered by insurance.<br /><br />I would like to break the sound into frequencies and amplitudes for the frequencies. The system would then amplify each frequency in a sound sample (10ms?) separately and combine the resulting frequencies outputting a 10ms processed interval. For speed, this would be run parallel on a multicore system or on a GPU, using something like PyCuda. Ideally, this would be done in real time. However, it could give a delayed result if speed is not possible. <br /><br />Am I on the right track? This seems like a simple problem using fft generating a frequency spectrum. Thanks.davidjensenhttps://www.blogger.com/profile/13207663434993578285noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-51038703524607932962012-06-22T21:00:11.182+01:002012-06-22T21:00:11.182+01:00i tried this on my xubuntu and the bottom graph (t...i tried this on my xubuntu and the bottom graph (the red one) don't come up at all, it's just plane white. not really getting why as i'm a newbie you might say at this high level math (i mean FFT). can someone help, i'm really interested in finding peak frequency at any (real) time of sound fileAnonymoushttps://www.blogger.com/profile/14401251401063628955noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-74695114081679010422012-06-01T13:21:01.896+01:002012-06-01T13:21:01.896+01:00another thing, the normalization should be twice t...another thing, the normalization should be twice that value:<br />Y = 2*fft(y)/n # fft computing and normalization<br />In this way the spectrum will have the amplitud of 1, the same as in the input.Anonymousnoreply@blogger.com