Hi,
Can someone give me an idea how to use the PWELCH? My graphic have the "expected shape", but the axis are totally wrong. The image of the comparative graphics is below: https://ibb.co/bAZgAo Thank you, Renato |
On Fri, May 25, 2018 at 10:12 AM, Renato S. Yamane <[hidden email]> wrote: Hi, Can you show your code that produced the graph? |
2018-05-25 16:29 GMT+02:00 Doug Stewart <[hidden email]>:
> On Fri, May 25, 2018 at 10:12 AM, Renato S. Yamane <[hidden email]> wrote: >> >> Can someone give me an idea how to use the PWELCH? >> My graphic have the "expected shape", but the axis are totally wrong. >> >> The image of the comparative graphics is below: >> https://ibb.co/bAZgAo > > Can you show your code that produced the graph? Hi Doug, Here is: == sampling_rate = 44100; length = 120; hpf = 40; lpf = 400; filter_order = 4; crest_factor = 12; typenoise = noise((length)*sampling_rate, 1, 'pink'); [z, p, k] = butter(filter_order, [hpf/(sampling_rate/2), lpf/(sampling_rate/2)]); sos = zp2sos (z, p, k); filtered = sosfilt(sos, typenoise); normalized = filtered / (rms(filtered) / 10^(-crest_factor/20)); while (normalized(normalized > 1) || normalized(normalized < -1)) normalized(normalized > 1) = 1; normalized(normalized < -1) = -1; normalized = normalized / (rms(normalized) / 10^(-crest_factor/20)); endwhile pwelch(normalized,hanning(4096), 'loglog'); == Thank you, Renato |
On Fri, May 25, 2018 at 10:36 AM, Renato S. Yamane <[hidden email]> wrote: 2018-05-25 16:29 GMT+02:00 Doug Stewart <[hidden email]>: Try pxx=pwelch(normalized,hanning(4096),[],sampling_rate,'db'); semilogx(10*log10(pxx)) This is closser to what you want pwelch(normalized,hanning( |
On Fri, May 25, 2018 at 11:13 AM, Doug Stewart <[hidden email]> wrote:
This is closer still semilogx(10*log10(pxx./1200)) but I don't know why! |
On Fri, May 25, 2018 at 11:31 AM, Doug Stewart <[hidden email]> wrote:
grid on |
In reply to this post by yamane
On Fri, May 25, 2018 at 16:12:32 +0200, Renato S. Yamane wrote:
> Can someone give me an idea how to use the PWELCH? > My graphic have the "expected shape", but the axis are totally wrong. > > The image of the comparative graphics is below: > https://ibb.co/bAZgAo If you believe there is a Matlab compatibility problem, please open a bug report with the details. The Octave pwelch function should behave identically to the Matlab function. -- mike signature.asc (849 bytes) Download Attachment |
2018-05-25 18:41 GMT+02:00 Mike Miller <[hidden email]>:
> On Fri, May 25, 2018 at 16:12:32 +0200, Renato S. Yamane wrote: >> Can someone give me an idea how to use the PWELCH? >> My graphic have the "expected shape", but the axis are totally wrong. >> >> The image of the comparative graphics is below: >> https://ibb.co/bAZgAo > > If you believe there is a Matlab compatibility problem, please open a > bug report with the details. The Octave pwelch function should behave > identically to the Matlab function. First of all, thank you Stewart! Now the axis are much better!! Miller, I don´t have a Matlab available at this moment... The result of the frequency response was compared using Audacity, on the image at the link above. Thank you, Renato |
Free forum by Nabble | Edit this page |