이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
How come I keep getting "Data Clipped" in my Command Window?
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
Star Strider
2014년 4월 29일
편집: Star Strider
2014년 4월 29일
You need to scale fur so that the maximum value is between [-1 +1] with wavwrite. Nice choice, BTW!
댓글 수: 22
Edgar
2014년 4월 29일
Could you show me the end result of how the line of code should look like that can resolve my issue? And where do I paste it?
Star Strider
2014년 4월 29일
편집: Star Strider
2014년 4월 29일
I no longer have wavwrite ( MATLAB R2014a has audioread and audoiwrite ) but the easiest way to scale fur to [-1 +1] is simply:
fur = fur/max(abs(fur));
Put it just before your wavwrite statement.
Edgar
2014년 4월 29일
When I added the code. I still get the data clipped message. See attached. Any suggestions?
Star Strider
2014년 4월 29일
As Walter Roberson noted in a similar answer, it may be necessary to scale it so that it’s never exactly [-1 +1].
Change the statement to :
fur = fur/max(abs(fur)+eps);
There’s a similar thread that started a few minutes ago.
Star Strider
2014년 4월 29일
Your code doesn’t look very long. Post it as an attachment to your original question (use the ‘paperclip’ icon above the window). I'll run it and see if I can reproduce the error, and if all goes well, suggest a fix for the problem.
Star Strider
2014년 4월 29일
I would appreciate your formatting it. I makes it easier to read and copy. Highlight your code, then click the [{}Code] button above the window.
Edgar
2014년 4월 29일
Do you have an email address I could send you my code? I tried to post it, but .docx file is unsupported here for some odd reason.
Star Strider
2014년 4월 30일
편집: Star Strider
2014년 4월 30일
It works perfectly for me.
I experimented, and changing the scaling line to:
fur = fur/max(abs(fur)+1E-4);
doesn’t change the sound, and no longer generates the ‘clipping’ warning! (Even adding 1E-5 generated the ‘clipping’ warning. Strange.)
Also, I suggest you change the fft plot to:
plot(f,abs(z))
to plot the amplitude of the fft. Otherwise, the plot only plots the real part, and gives a warning about ignoring the imaginary part. You might also consider:
axis([-750 750 ylim])
just after the plot statement. There doesn’t seem to be anything of significance outside those limits.
Star Strider
2014년 4월 30일
편집: Star Strider
2014년 4월 30일
It’s not your version of MATLAB, it’s some sort of idiosyncrasy in wavwrite. I’m getting it too in R2014a. That’s probably the reason audiowrite and audioread are replacing the others.
Edgar
2014년 4월 30일
I see, well my data clipping issue is resolved it doesn't popup anymore. Except my song doesnt work for some odd reasons because of format problems. I tried using windows media player and vlc media player and won't play the format for some reason. Any ideas?
Star Strider
2014년 4월 30일
It plays perfectly for me.
Add:
soundsc(x)
after the wavread statement to hear it. Playing x rather than fur verifies that it saved and read successfully.
Edgar
2014년 4월 30일
Yes! Its playing! Thanks so much! Now where can I control the song, meaning pause, play, stop, etc? It plays within matlab rather than an external app.
Star Strider
2014년 4월 30일
Great!
I haven’t experimented much with audioplayer, but apparently it has those capabilities. I know that sound and soundsc don’t. If you have audioplayer, experiment with it to see if it will do what you want.
Image Analyst
2014년 4월 30일
Just rename the function calls. But I believe audioplayer() is with the latest, or very recent versions only. At least that's when I started to get warnings to use audioplayer() instead of sound(). If you have R2014a you should be okay.
Star Strider
2014년 4월 30일
If you save the files to a format compatible with Windows Media Player or some such, you should be able to play them through it. I don’t have access to the wavwrite documentation, so you will have to explore that to see. I remember that it was possible to save to different formats, but I don’t have recent experience with wavwrite, so I don’t remember the details. You may also have to ask Windows Media Player what it likes. Earlier versions played ‘.wav’ files.
Walter Roberson
2014년 4월 30일
1E-5 might be lower than eps(abs(fur)). Instead of
fur/max(abs(fur)+eps);
should use
fur/max(abs(fur)*(1+eps));
or alternately
fur/max(abs(fur)+eps) * (1-eps);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)